delete and __delete not equivalent

Imperatorn johan_forsberg_86 at hotmail.com
Sat Jan 16 11:27:37 UTC 2021


On Saturday, 16 January 2021 at 04:52:05 UTC, Adam D. Ruppe wrote:
> On Friday, 15 January 2021 at 14:38:55 UTC, Steven 
> Schveighoffer wrote:
>> [...]
>
> Yeah, in my private implementation, I have a sanity check that 
> the pointer and the base aren't too far apart. I figured they 
> didn't line up due to a capacity cache or similar metadata at 
> the beginning of the block (though I didn't prove this) and 
> thus the pointers shouldn't be more than like 16 bytes apart 
> and anything more than that is suspicious.
>
> [...]

Any way, this should be included in the next release imo.

It doesn't look good for D to have memory leaks when using the 
recommended alternative to delete...


More information about the Digitalmars-d mailing list