3 releases

0.1.2 Jul 4, 2022
0.1.1 Jun 27, 2022
0.1.0 Jun 27, 2022

#172 in Windows APIs

GPL-2.0 license

19KB
333 lines

rshmem

crates.io mio

This crate provides a wrapper around win32 shared memory APIs. It provides an easy way to allocate, link allocations and deallocate buffers.

Usage

    let memory = Memory::new("test2", 100, 0x6BC00000).unwrap();

    // allocate first buffer
    let buffer1 = memory.allocate(4).unwrap();

    // allocate second buffer
    let buffer2 = memory.allocate(4).unwrap();

    // allocate a buffer and link it to the second
    let child = memory.allocate_more(4, buffer2).unwrap();

    // deallocate the first buffer
    memory.deallocate(buffer1);

    // deallocate the second buffer, it will deallocate all child buffers
    memory.deallocate(buffer2);

License

Contribution

Feel free to create pull requests

Dependencies

~225KB