GC object finalization not guaranteed
Leandro Lucarella
llucax at gmail.com
Sun Apr 19 09:08:43 PDT 2009
Don, el 19 de abril a las 07:35 me escribiste:
> Leandro Lucarella wrote:
> >I think shared memory is an example of memory resource that's not freed by
> >the OS on program exit.
>
> Really? That sounds like an OS memory leak. Security issue, too: run
> your program, allocated shared memory, then exit. Repeat until all
> memory is exhausted.
man 3 shm_open
Anyways. Again, the discussion is diverging very quickly. The point is,
according to the specs, the GC is allowed to not call finalizers at all.
So any current D program relying on the GC calling a destructor *ever* is
broken according to the specs, even when destructors are used for weak
pointers, for freeing malloc'ed memory or anything.
I think finalizers should be removed or fixed (I vote for the latter,
because it's easy and efficient to fix it).
Even more, I'm considering this a bug in the specs even for D1, so I'll
file a bug for this.
--
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Mi mami llevo a tu papi con el fuquete! Menéalo! Mi mami llevo a tu
papi con el fuquete!
-- Sidharta Kiwi
More information about the Digitalmars-d
mailing list