vestigial delete in language spec
Don Clugston
dac at nospam.com
Fri Nov 2 01:40:15 PDT 2012
On 01/11/12 22:21, Dan wrote:
> TDPL states
> ------
> However, unlike in C++, clear does not dispose of the object’s
> own memory and there is no delete operator. (D used to have a
> delete operator, but it was deprecated.) You still can free
> memory manually if you really, really know what you’re doing by
> calling the function GC.free() found in the module core.memory.
> ------
> The language spec has this example from the section on Struct
> Postblits:
> ------
> struct S {
> int[] a; // array is privately owned by this instance
> this(this) {
> a = a.dup;
> }
> ~this() {
> delete a;
> }
> }
> ------
>
> Is the delete call, then per TDPL not necessary? Is it harmful or
> harmless?
>
> Also, are there any guidelines for using and interpreting the output of
> valgrind on a D executable?
>
> Thanks
> Dan
You'll probably have trouble getting much out of valgrind, because it
doesn't support 80-bit floating instructions, unfortunately.
More information about the Digitalmars-d-learn
mailing list