[Issue 1985] import expression should return ubyte[] not string
Janice Caron
caron800 at googlemail.com
Fri Apr 11 01:32:24 PDT 2008
On 11/04/2008, d-bugmail at puremagic.com <d-bugmail at puremagic.com> wrote:
> Maybe even imported type should be void[], so that it must be explicitly casted
> to proper type.
No, it should be ubyte. The reason is that void arrays can contain
pointers, and ubyte arrays can't. A void array means that the garbage
collector has to scan it, looking for anything that looks like it
might be an address, and if it finds such a collection of bits by
accident, then something will be marked as "in use", that actually
isn't.
If the array came from a file, it can't very well have meaningful
pointers into RAM, so I agree with the original poster that it should
be ubyte[] for D1, and I would add invariant(ubyte)[] for D2.
More information about the Digitalmars-d-bugs
mailing list