D Kernel Development

Sean Kelly sean at invisibleduck.org
Wed Nov 11 22:05:38 PST 2009


Tim Matthews Wrote:

> Jesse Phillips wrote:
> > On Wed, 11 Nov 2009 20:02:16 -0800, Walter Bright wrote:
> > 
> >> If you don't use things that rely on the gc, the runtime support needed
> >> by D2 is very minimal. You'd need to avoid:
> >>
> >> . resizing arrays
> >> . associative arrays
> >> . closures
> >> . of course, any use of new
> >> . array concatenation
> >>
> >> and the rest is pretty good to go.
> > 
> > Could I get a clarification here? You say not to use 'new' but Sean Kelly 
> > is saying that it is still usable. I of course place greater weight on 
> > your word. If 'new' is not an option does that take using objects out of 
> > the equation?
> > 
> > Just collecting details for: http://www.prowiki.org/wiki4d/wiki.cgi?
> > GarbageCollector
> 
> 
> I think new should work fine if you explicitly call delete. sean: If 
> that is not really the case then it should be?

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.



More information about the Digitalmars-d mailing list