Is there a GC'd malloc alternative?

Lutger lutger.blijdestijn at gmail.com
Tue Feb 20 02:52:23 PST 2007


Bill Baxter wrote:
> You need to be careful with that kind of thing because the garbage
> collector needs to know whether each chunk of allocated memory could
> contain pointers or not.
> 
> If you allocate as void (as Johan recommended) the gc will assume that
> pointers *are* possible in that memory.  That's great if you plan on
> putting things with pointers in there, but if you're just going to use
> it for some kind of raw data then you'll be wasting time having the gc
> scan that memory.

This should also work right? 
std.gc.hasNoPointers(rawData.ptr);



More information about the Digitalmars-d mailing list