if i understand correctly, static arrays are exempt from GC scanning for memory
pointers
http://dlang.org/garbage.html : "Pointers in D can be broadly divided into two categories: Those that point to garbage collected memory, and those that do not. Examples of the latter are pointers created by
On Thursday, 26 February 2015 at 01:15:37 UTC, captaindet wrote:
pointers to static data."
Keep in mind that this is pointers TO static data - that is, if
the object itself is static, it is not to be collected.
static int[5] foo = [1,2,3,4,5]; // foo will never be collected,
even if there a
On 2015-02-25 19:24, Adam D. Ruppe wrote:
does this warning only apply to dynamic void[] arrays but not to static
void[CTconstant] arrays?
Both of those will be scanned for pointers.
thanks, adam,
so i should always use
struct Stuff2Do{
static ubyte[1024*1024] buffer4speed = void; // e
You don't have to do all that, if it is typed ubyte[] instead of
void[], it shouldn't be scanned at all anyway.
On Wed, Feb 25, 2015 at 08:20:37PM -0600, captaindet via Digitalmars-d-learn
wrote:
[...]
> struct Stuff2Do{
> static ubyte[1024*1024] buffer4speed = void; // even if untyped at this
> point
>
> // more
> }
[...]
Tangential note: be careful with putting a large static array inside a
str
On Wed, 25 Feb 2015 20:20:37 -0600, captaindet wrote:
> On 2015-02-25 19:24, Adam D. Ruppe wrote:
>>> does this warning only apply to dynamic void[] arrays but not to
>>> static void[CTconstant] arrays?
>>
>> Both of those will be scanned for pointers.
>
> thanks, adam,
>
> so i should always us
On 2015-02-25 20:45, H. S. Teoh via Digitalmars-d-learn wrote:
On Wed, Feb 25, 2015 at 08:20:37PM -0600, captaindet via Digitalmars-d-learn
wrote:
[...]
struct Stuff2Do{
static ubyte[1024*1024] buffer4speed = void; // even if untyped at this
point
// more
}
[...]
Tangential note:
On 2/25/15 8:15 PM, captaindet wrote:
if i understand correctly, static arrays are exempt from GC scanning for
memory pointers
http://dlang.org/garbage.html : "Pointers in D can be broadly divided
into two categories: Those that point to garbage collected memory, and
those that do not. Examples
On 2015-02-26 10:07, Steven Schveighoffer wrote:
Static data I believe is always scanned conservatively because no
type information is stored for it ever, even on allocation (i.e.
program startup).
ouh, the confusion goes on... are you saying that
{
// will be all scanned by GC for
/
On 2/26/15 11:57 AM, captaindet wrote:
On 2015-02-26 10:07, Steven Schveighoffer wrote:
Static data I believe is always scanned conservatively because no
type information is stored for it ever, even on allocation (i.e.
program startup).
ouh, the confusion goes on... are you saying that
{
On 2015-02-26 12:07, Steven Schveighoffer wrote:
On 2/26/15 11:57 AM, captaindet wrote:
On 2015-02-26 10:07, Steven Schveighoffer wrote:
Static data I believe is always scanned conservatively because no
type information is stored for it ever, even on allocation (i.e.
program startup).
ouh, th
On 02/26/2015 10:07 AM, Steven Schveighoffer wrote:
>> // will not be scanned by GC for pointers:
>> void[] buffer4 = cast(void[])(new ubyte[16]);
>> uint[] buffer5 = cast(uint[])(new ubyte[16]);
>
> Correct, since they are allocated as ubyte[]. uint[] also would not be
> scanned.
On 2/26/15 2:28 PM, Ali Çehreli wrote:
On 02/26/2015 10:07 AM, Steven Schveighoffer wrote:
>> // will not be scanned by GC for pointers:
>> void[] buffer4 = cast(void[])(new ubyte[16]);
>> uint[] buffer5 = cast(uint[])(new ubyte[16]);
>
> Correct, since they are allocated as
13 matches
Mail list logo