On Thu, 17 Apr 2014 10:05:49 -0400, Regan Heath <[email protected]> wrote:

On Thu, 17 Apr 2014 13:59:20 +0100, Steven Schveighoffer <[email protected]> wrote:
It was never possible. You must explicitly cast to void[].

to -> from?

Yes, sorry :)

void[] makes actually little sense as the result of whole-file read that allocates. byte[] is at least usable and more accurate. In fact, it's a little dangerous to use void[], since you could assign pointer-containing values to the void[] and it should be marked as NOSCAN (no pointers inside file data).

I see what you're saying, byte[] is what *is* allocated.. but my point is that it's not what those bytes actually represent.

Are you saying void[] *is* currently marked NOSCAN?

No, I mean the return value from read, since it's newly allocated general data, should be marked NOSCAN.

Casting the type does not change how the block is marked, only the allocation type makes that distinction. When you *allocate* a void[] buffer, it's marked no scan. But when you allocate a byte[] buffer and implicitly cast it to void[], it's not marked NOSCAN.

TL;DR, IMO read should return byte[].

-Steve

Reply via email to