Denis Koroskin wrote:
On Sun, 31 May 2009 22:45:23 +0400, Vladimir Panteleev
<[email protected]> wrote:
I just went through a ~15000-line project and replaced most occurrences
of void[]. Now the project is an ugly mess of void[], ubyte[] and casts,
but at least it doesn't leak memory like crazy any more.
I don't know why it was decided to mark the contents of void[] as "might
have pointers". It makes no sense!
FWIW, I also consider void[] as a storage for an arbitrary untyped binary
> data, and thus I believe GC shouldn't scan it.
You're contradicting yourself there. void[] is arbitrary untyped data,
so it could contain uints, floats, bytes, pointers, arrays, strings,
etc. or structs with any of those.
I think the current behavior is correct: ubyte[] is the new void*.
I also agree that std.file.read (and similar functions) should return
ubyte[] instead of void[], to prevent surprises after concatenation.
L.