Conversation

imagine this: you want to implement arbitrary-precision integers in Go, but avoid indirections/allocating arrays for small values (< 2^32). you don't have unions. how do you solve this? that's right, you reserve 4 gigabytes and treat any pointer in that range as a integer value
Image
31
1,179
unix.stackexchange.com/questions/5096 the vast majority of virtual memory is considered non-canonical since x86_64 requires that the top bits unused in address translation, be sign-extended. I wonder if you could skip the mmap() by masking small ints so they exist outside of canonical addrs?
5
74
ah cool, Intel has something similar in the works (linear address masking). it seems like these features encourage MSB pointer tagging instead of discourage them, since the height of the page table hierarchy hasn’t changed. you just save an AND w/ a mask before dereferencing
1