
I don't like that 1-hack for the NULL values in offset_ptr and I don't understand why it's necessary. If NULL is outside the memory segment -- so what? NULL should never be dereferenced anyway... There should be a "just works" solution and there's no need for
"Tobias Schwinger" wrote: parametrization, here. Maybe I don't understand
the problem correctly.
It is about converting an offset value into pointer. Offset 0 means that the data didn't move, their absolute address stayed the same. Offset 1 meaning always NULL is based on assumption that no one ever will use a pointer pointing inside self, to the second byte of self. ala char* p; p = (char*)&p + 1; I argue somewhere that this is enough for absolutely all practical situations and that other, more complicated types of offset pointer can be removed from shmem. /Pavel