Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ability to "mlock" the buffer? #3

@mgeier

Description

@mgeier

The JACK ring buffer provides this, see https://jackaudio.org/api/ringbuffer_8h.html#aeb059ff23c65389d48ebbe948f05c2b2.

The libc crate seems to be able to do this:

https://docs.rs/libc/0.2.79/libc/fn.mlock.html
https://docs.rs/libc/0.2.79/libc/fn.munlock.html

It should be simple to add this as a method to RingBuffer.

The JACK wrapper also provides it:

https://docs.rs/jack/0.7.0/jack/struct.RingBuffer.html#method.mlock

Windows might need special treatment with https://docs.rs/winapi/0.3.9/winapi/um/memoryapi/fn.VirtualLock.html?

Do we have to expose mlock() as unsafe?

Probably it would be better to simply provide an (unsafe?) method to expose the underlying memory as a pointer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions