And it's not like Apple isn't aware of the dangers, either; they used top-byte tagging on the 68000, and it took them a lot of time and effort to migrate away from that to support 16+ MB systems.
It's common for libraries to use the 2 lowest bits in tree structures e.g. RB tree. It's not a problem at all since the data structure is controlled by the library. Even if tree nodes are allocated/provided by the user, having a "4-byte aligned" requirement in the API contract isn't a problem at all -- in fact you need to work quite hard to allocate a structure with a pointer that isn't at least 4 byte aligned (i386), or 8 byte aligned (x64).
If you build your whole app with it, yeah. If you use it tactically for a certain data type it can be very nice. Just don't try to dissimulate it's specialness.
masklinn|1 year ago
OCaml's also been using tagging to mark unboxed type pretty much from the start, nearly 30 years ago: https://dev.realworldocaml.org/runtime-memory-layout.html#:~....
duskwuff|1 year ago
jstimpfle|1 year ago
a1369209993|1 year ago
Well, no, actually; it's:
It's just quite implausible that you'd do that by accident.db48x|1 year ago
gpderetta|1 year ago
rjsw|1 year ago
lmm|1 year ago
Wasn't it part of the reason they ended up with poor "mechanical sympathy" on regular PCs, and got a bad performance reputation as a result?
_flux|1 year ago
mbrubeck|1 year ago
https://docs.rs/smallbitvec/
I'm pretty sure you can find several more examples in Firefox, as well as other major browsers.
junon|1 year ago
Lua, Lisps, many others.
titzer|1 year ago
WasmGC has a i31ref as part of its reference hierarchy, which is implemented with pointer tagging.
pixelesque|1 year ago
coldtea|1 year ago
adql|1 year ago
adql|1 year ago
speed_spread|1 year ago