logoalt Hacker News

drzaiusx11today at 12:57 PM4 repliesview on HN

Am I understanding this correctly: a value type really only works when it fits on a 64 bit "cache line", and when larger, it falls back to normal heap allocated objects as before? Seems extremely limiting, no? Great for a boxing optimization, but not much else unless you're deal with very small data types regularly...


Replies

exidextoday at 5:37 PM

Larger types are supported, there is A notion of tearing. According to JVM spec even long and double could tear, not sure about practical implications though

mattstirtoday at 1:51 PM

That's true for arrays of these value classes. Scalarization would help for larger local values though, since those would avoid pointer indirection for purely local values.

logicchainstoday at 5:06 PM

Surely it can't be that, it destroys basically the entire value proposition of value types, unless you use a preprocessor to write everything as SOA.

lowbloodsugartoday at 4:01 PM

And one bit for null! So “smaller data types” means 32bits! Yay! It’s 1995 again!