Migrating the primitive boxes to values
Jack Ammo
jackammo77 at gmail.com
Sat Jan 26 08:08:58 UTC 2019
>From an outsider's perspective, i'd like to ask a perhaps naive question
about the locking issue on values. Instead of just opting to break existing
code as you seem to be worried about, why not just box the value before
locking? Assuming that a boxing conversion to a full fledged Object is
still kicking around as a fall back, this seems like the most familiar
option to me as a developer: i can technically do the lock on an Integer
but it is not advised and results are not guaranteed. I understand that
everyone has worked hard to avoid the cost of boxing, but in this
particular case it seems like a decent option that is the least difficult
to wrap my mind around. Locking requires a full Object, so values (like an
int) need to be boxed as such.
More information about the valhalla-spec-comments
mailing list