1. 9
  1. 5

    What if the objects contain pointers? Instead of using pointers, we use the offset to the mmap base address to reference objects.

    I’ve done experiments with this, and I don’t recommend it.

    If you really want to tie up a register, use %gs instead. This way, the file offset is the %gs-relative offset. GCC produces decent code like this, but clang produces dogshit (as usual) and you’re stuck on systems without segment or base registers.

    My current recommendation is to store pointers relative to the object pointing them. This means that when you do IPC, as long as your “message” is as compact as possible, you don’t have to do any special decoding steps, since relative pointers in the send stream will still be relative pointers in the receive stream.