D Kernel Development

bearophile bearophileHUGS at lycos.com
Thu Nov 12 02:40:17 PST 2009


Walter Bright:
>You'd need to avoid:
. resizing arrays
. associative arrays
. closures
. of course, any use of new
. array concatenation<


Sean Kelly:
> Right.  I think Walter meant that "new" would use the GC for allocation, so stubbing out gc_malloc() entirely will break "new".  I suggested replacing the GC with a non-collecting allocator, something like the malloc/free-based stub in Druntime.  Using this, "new" will work but you'll have to call "delete" to release the memory.<

It can be useful to have a single compilation flag that replaces the GC with the stub, removes the larger GC from the binary, and totally disallows the usage of array resizes, array concatenations, associative arrays and closures.

Bye,
bearophile



More information about the Digitalmars-d mailing list