when is the object destuctor called?
Walter Bright
newshound at digitalmars.com
Wed May 24 20:38:59 PDT 2006
Ben Hinkle wrote:
> Personally I would not rely on the using the GC to manage anything other
> than main memory. Why? If the user doubles their main memory but doesn't
> change their graphics memory then the GC might decide to collect object less
> often (since there's much more memory around) and so the graphics memory
> fill up before the GC decides it needs to do a collection. The GC should
> only be used to mange what it knows about: main memory. Anything else is a
> latent bug that depends on the end user's system configuration.
> Note that's actually why I don't have any destructors in Cx - they lull
> programmers into a false sense of security. In Cx the GC manages main memory
> and any other resource needs to be managed by the programmer.
That's right. GC is a marvelous mechanism for managing memory, but not
for other resources.
More information about the Digitalmars-d
mailing list