[Issue 14134] Free of large array does not work
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Feb 6 10:33:49 PST 2015
https://issues.dlang.org/show_bug.cgi?id=14134
--- Comment #3 from Steven Schveighoffer <schveiguy at yahoo.com> ---
OK, so I have a problem with the current code:
1. When we say new T[x], we get a pointer not to the point of the block
2. delete is supposedly going to be deprecated.
So if the code stays as it is, our promoted method of destroying an array is no
good. There is no good way to destroy an array except delete.
I think we definitely should fix _d_delarray_t, as dtors should not be called
more than once, and to have it not free the data is bad.
But I think we need some way of saying this block can still be freed because
even though it's not the base pointer, the data before the pointer is owned by
the runtime, and invisible to the user. And I really think that should be done
in GC.free.
--
More information about the Digitalmars-d-bugs
mailing list