Skip to content

Use relative pointers within shared-memory tables #25

Description

@bovine

Currently shared-memory tables store physical pointer addresses of other records and strings within shared-memory. This has the side effect of necessitating enforcement that attaching to an existing shared-memory table is able to be allocated at the same memory address. In general, it is not possible for the OS to guarantee that the same virtual address location will be available for mmap() in another process so the current method is really only well-suited for use by processes that inherit the table through forking, or independent processes that happen to be lucky when calling mmap.

Switching all absolute pointers to be relative pointers (with respect to the address of the shared-memory block) will have a slight performance penalty but will allow greater flexibility. By using a preprocessor #define around all pointer operations, it would be possible to conditionally switch on/off use of relative pointers at compile-time if we believe the performance hit is significant.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions