2 ms·
I'd be interested to see how far this can be taken... Why not make pointers just 4 bits, giving them only 15 possible memory locations they can point to? The
by londons_explore 7y ago
I'd be interested to see how far this can be taken...
Why not make pointers just 4 bits, giving them only 15 possible memory locations they can point to? Then try to allocate the thing they'll be pointing at in one of those 15 locations. Reserve the 16th location for some kind of backup data structure which can point anywhere.
Clearly it isn't branchless, but I would guess that most codepaths would either always be able to make use of one of the 15 locations, or would never be able to, making branches predictable.
- unwind 7y agoFour bits is probably too low, since you would need to fit other data into the renaining bits in order not to waste them. The x86 is (merely) byte-addressable so a byte is the smallest piece of data that makes sense for an "object", as far as I know.
- londons_explore 7y agoNearly all objects are full of pointers. You can pack loads in if they're 4 bit.
- verwaest 7y agoSounds like a fun project in the context of a moving GC :)