Timothee Cour:
is the following true?
int*[N] a=void;
foreach(i;N)
a[i]=fillValue(i);// some leaks may occur during foreach loop
//at the next GC run, no more leaks due to that piece of code
I think so, but I am not an expert on GC matters, I have not yet
written a similar GC.
Bye,
On Sat, Sep 21, 2013 at 7:23 AM, bearophile bearophileh...@lycos.comwrote:
simendsjo:
I'm setting every element in the array, and every field of the
element, so I should be safe, right?
I think that's sufficiently safe. If the GC run before you have
initialized those fields, and some of
This is incorrect, but what is the correct syntax? The arrays
page only says it's an advanced feature, but doesn't show the
syntax.
int[] a = new int[1](void);
simendsjo:
This is incorrect, but what is the correct syntax? The arrays
page only says it's an advanced feature, but doesn't show the
syntax.
int[] a = new int[1](void);
The simplest way to allocate a void-initialized GC-managed
dynamic array in D is probably to use one of the two
On Saturday, 21 September 2013 at 10:40:07 UTC, bearophile wrote:
simendsjo:
This is incorrect, but what is the correct syntax? The arrays
page only says it's an advanced feature, but doesn't show
the syntax.
int[] a = new int[1](void);
The simplest way to allocate a void-initialized
simendsjo:
Thanks. uninitializedArray works well for my need.
uninitializedArray is the wrong function to use in 99.9% of the
times. std.array docs probably have not explained you well enough
the risks of its usage.
Bye,
bearophile
On Saturday, 21 September 2013 at 11:36:32 UTC, bearophile wrote:
simendsjo:
Thanks. uninitializedArray works well for my need.
uninitializedArray is the wrong function to use in 99.9% of the
times. std.array docs probably have not explained you well
enough the risks of its usage.
Bye,
simendsjo:
I'm setting every element in the array, and every field of the
element, so I should be safe, right?
I think that's sufficiently safe. If the GC run before you have
initialized those fields, and some of those fields are
references/pointers, that could cause memory leaks until the
On 21/09/13 16:23, bearophile wrote:
I think that's sufficiently safe. If the GC run before you have initialized
those fields, and some of those fields are references/pointers, that could cause
memory leaks until the next time the GC runs.
Thanks for clarifying where un vs. minimally matters