Re: Performance of GC.collect() for single block of `byte`s

2018-09-28 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 24 September 2018 at 14:31:45 UTC, Steven Schveighoffer wrote: Why is the overhead so big for a single allocation of an array with elements containing no indirections (which the GC doesn't need to scan for pointers). It's not scanning the blocks. But it is scanning the stack. Ok,

Re: Performance of GC.collect() for single block of `byte`s

2018-09-28 Thread Per Nordlöw via Digitalmars-d-learn
On Friday, 28 September 2018 at 09:14:18 UTC, Per Nordlöw wrote: How is it possible for the GC to be 500-1000 times slower than a malloc-free call for a single array containing just bytes with no indirections for such a simple function!!!? I really don't understand this... I change the code

Re: Performance of GC.collect() for single block of `byte`s

2018-09-28 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 24 September 2018 at 14:31:45 UTC, Steven Schveighoffer wrote: ever growing task. And really, this isn't that much (at the end, you are still less than 1ms). Compared to GCs like Go's this is an enormous latency for a single allocation of value elements.

Re: vibe.d error

2018-09-28 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Thursday, 27 September 2018 at 17:37:43 UTC, hridyansh thakur wrote: [snip] What version of dmd do you use?

Re: Performance of GC.collect() for single block of `byte`s

2018-09-28 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 24 September 2018 at 14:31:45 UTC, Steven Schveighoffer wrote: It's not scanning the blocks. But it is scanning the stack. Each time you are increasing the space it must search for a given *target*. It also must *collect* any previous items at the end of the scan. Note that a collec

Re: Can I create static c callable library?

2018-09-28 Thread Atila Neves via Digitalmars-d-learn
On Thursday, 27 September 2018 at 23:53:50 UTC, Steven Schveighoffer wrote: On 9/27/18 8:16 AM, Atila Neves wrote: On Tuesday, 25 September 2018 at 14:13:50 UTC, Jacob Carlborg wrote: On Tuesday, 25 September 2018 at 12:05:21 UTC, Jonathan M Davis wrote: If you use -betterC, then it's trivial

Re: Weird compilation error only as static library

2018-09-28 Thread Andrea Fontana via Digitalmars-d-learn
On Wednesday, 26 September 2018 at 19:08:45 UTC, Márcio Martins wrote: Hi! I am getting this error when compiling my code as a static library. It works fine as an executable. I have no idea what's happening. Has someone seen something like this before? What could be different? This is the e

Re: Can I create static c callable library?

2018-09-28 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Sep 28, 2018 at 02:08:25PM +, Atila Neves via Digitalmars-d-learn wrote: > On Thursday, 27 September 2018 at 23:53:50 UTC, Steven Schveighoffer wrote: [...] > > Since C initialization functions have no order to them, it's > > possible that some initialization functions in the D runtim

Re: Weird compilation error only as static library

2018-09-28 Thread Márcio Martins via Digitalmars-d-learn
On Friday, 28 September 2018 at 15:24:03 UTC, Andrea Fontana wrote: On Wednesday, 26 September 2018 at 19:08:45 UTC, Márcio Martins wrote: Hi! I am getting this error when compiling my code as a static library. It works fine as an executable. I have no idea what's happening. Has someone seen

Re: Sending Tid in a struct

2018-09-28 Thread Chris Katko via Digitalmars-d-learn
On Wednesday, 23 November 2016 at 08:47:56 UTC, Christian Köstlin wrote: On 03/03/2012 18:35, Timon Gehr wrote: On 03/03/2012 12:09 PM, Nicolas Silva wrote: [...] Yes, this seems to be a bug. Workaround: struct Foo{ string s; Tid id; } void foo(){ Foo foo; receive((Tuple!(s

Delegates with stackpointers

2018-09-28 Thread Ritchie via Digitalmars-d-learn
How does a delegate with a stackpointer work? e.g. in this example: https://run.dlang.io/is/XviMSl Does the second call to foo not overwrite the stack of the first call and thereby the data pointed to by bar1? How is that data preserved?