|
|
|
|
|
by jcul
1955 days ago
|
|
I guess it checks it when you actually try to dereference the pointer?
On Intel too you still have to "repair"the pointer before you use it.
It's definitely not the safest optimisation but it can be used to great effect when needed. I think Intel is adding CPU support for pointer tagging operations in the future which should make them a lot easier / safer / more efficient to work with, though I can't find a reference now, it doesn't refer to it as pointer tagging. Any more information on encoding the type information in virtual memory layout? Sounds cool. I guess you have different types allocated in specific regions? |
|
And you are right that the tag inside address trick involves allocating objects of same type in different continuous regions. Usually such that whole page contains object of same type (as far as the tagging scheme is concerned) and by either masking off lower ten-ish bits of pointer you get to type header or you have some global out-of-line map of page frame->type.