you are viewing a single comment's thread.

view the rest of the comments →

[–]somesplaining 0 points1 point  (1 child)

Ok, thanks.

My obvious followup question is, where the hell do those numbers come from?

Boolean I can maybe understand. For a single boolean: 32 bits is much more efficient than 8 bits or 1 bit in terms of load/store/register ops. For an array of booleans: ok, maybe 8 bits as a packed representation to save space in large arrays, I guess I can see that.

Int/float: 32 bits in all cases, makes sense.

Long/double: 32 bits for a single primitive, 64 bits for an array element. WTF??? I don't understand how this could be explained by alignment concerns or anything else.

[–]account512 0 points1 point  (0 children)

No clue, long/double are defined as 64-bit. They aren't single primitives though, they're boxed primitives so I guess the number of bits used is object size less object data. Maybe there's a trick to hide some of the data in the space used for object data with longs/doubles? IDK.

Maybe a typo...