Comment #0 by andrej.mitrovich — 2013-03-11T12:08:29Z
There is no documentation stating how static void arrays are implemented.
In particular, what is their actual element size? It seems they're byte-sized:
void main()
{
byte[2] x;
int[2] y;
void[2] a = x; // ok
void[2] b = y; // runtime error: 8 bytes does not fit into 2 bytes
}
But this needs to be documented. The last statement should probably also be a compile-time error.
Comment #1 by hsteoh — 2013-03-15T10:41:30Z
I don't like the concept of void[]. It makes me think the element size is 0, and therefore the array is always 0-sized. But it seems the element size of void[] is 1. So then why not ubyte[]? That's basically what it is: you're treating the data as an array of bytes instead of an array of whatever other type it may have been.
(Yes an unsafe cast is needed but you're already doing that implicitly by passing T[] to void[] in the first place.)
Comment #2 by andrej.mitrovich — 2013-03-17T12:59:25Z
(In reply to comment #1)
> I don't like the concept of void[].
Well the theory is the GC would avoid scanning ubyte[] for pointers unlike void[]. I don't know if that's true or not, it's been mentioned in the newsgroups a few times.
Hooray! Close this bug now, or wait for the GC guarantee issue to be fixed first?
Comment #9 by andrej.mitrovich — 2014-12-06T00:22:27Z
(In reply to hsteoh from comment #8)
> Hooray! Close this bug now, or wait for the GC guarantee issue to be fixed
> first?
GC seems to be a hot potato right now, we shouldn't let it block these needed doc fixes. :)
Comment #10 by github-bugzilla — 2014-12-06T16:16:41Z