Deterministic resource freeing - delete deprecation (again)

Alexander aldem+dmars at nk7.net
Wed Apr 27 08:41:39 PDT 2011


On 27.04.2011 17:23, Steven Schveighoffer wrote:

> I think the only difference between the destructor (finalizer) and dispose is
> that dispose is guaranteed that all the memory is still allocated, whereas the finalizer is not given that guarantee.

  Not really. Dispose() may be called more than once, there is no guarantee that resources are still allocated.

> The name choice is no longer up for debate.  It's already set in print, and in the language.

  Well, it took me some time to find it out "in print" and "in the language", given that everywhere on site no single reference to it, and in most recent D2 it doesn't work correctly.

  Not to mention that it conflicts with std.container and std.array, where semantics of clear() is quite different (removes elements) - are those will be changed too?

/Alexander


More information about the Digitalmars-d mailing list