What's the D way of allocating memory?
monarch_dodra
monarchdodra at gmail.com
Thu Aug 8 03:53:46 PDT 2013
On Wednesday, 7 August 2013 at 22:03:16 UTC, Ali Çehreli wrote:
> On 08/07/2013 01:16 PM, monarch_dodra wrote:
>
> > On Wednesday, 7 August 2013 at 18:56:40 UTC, Ali Çehreli
> wrote:
>
> >> But question to others: I wouldn't want garbage filled
> memory, right?
> >> So I should consider GC.calloc first.
>
> > Depends on why you think garbage is a problem I guess.
> >
> > If it is because of false pointers
>
> Precisely.
>
> >, yet you aren't storing any pointers, then simply allocate
> > using GC.BlkAttr.NO_SCAN. Then, garbage won't be a problem.
>
> But the attribute is in effect throughout the lifetime of that
> memory block, right?
I *think*, however, GC.realloc and GC.extend take a BlkAttr
attribute, and I'm not sure how that works if they don't match...
More information about the Digitalmars-d-learn
mailing list