Crates.io | rshmem |
lib.rs | rshmem |
version | 0.1.2 |
source | src |
created_at | 2022-06-27 14:09:48.241039 |
updated_at | 2022-07-04 13:52:04.072635 |
description | Win32 shared memory with safe wrapper for allocating buffers |
homepage | |
repository | https://github.com/bloc4ain/rshmem |
max_upload_size | |
id | 614142 |
size | 36,521 |
This crate provides a wrapper around win32 shared memory APIs. It provides an easy way to allocate, link allocations and deallocate buffers.
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);
Feel free to create pull requests