Skip to content

The old memory mapping ringbuffer trick use-case #5

Description

@Daniel-Abrecht

I would love multiple memories & memory mapping. But I'm unsure if this proposal could cover my use cases.

For example, in some of my programs, like in this library, I use memory mapping to make ring buffers: https://github.com/Daniel-Abrecht/ml666/blob/0d4111f7a47bbcfd84b8136526aa1510c02e820d/src/tokenizer.c#L133

Basically, I map 1 real page to 2 virtual pages next to each other, that way, there is always an offset in the first buffer, where I can read, and one where I can write, the whole used/free space continuously. I don't think this proposal would let me do that.

It' still better than nothing, though. I think I could still emulate APIs like sharing memory using files and/or unix sockets with this abstraction, with some limitations.

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