Crates.io | fluke-buffet |
lib.rs | fluke-buffet |
version | 0.2.0 |
source | src |
created_at | 2023-10-03 01:03:44.664264 |
updated_at | 2024-05-28 22:18:23.663462 |
description | Buffer management for the `fluke` crate. |
homepage | |
repository | https://github.com/bearcove/fluke |
max_upload_size | |
id | 990668 |
size | 91,226 |
This crate is mostly a terrible idea, but it's doing buffer management
for fluke
.
It's designed to memmap a big chunk of memory and then, well, hand out reference-counted (non-thread-safe) pieces of it. It was faster than stack allocation in some benchmark I did a while ago.
Also, it's compatible with io_uring in that you can give ownership of one of the pieces to a read/write operation and nobody else is able to use it until that operation is done, which is really neat.
There's a bunch of splitting operations that try to maintain reference count and the general "one mutable reference XOR multiple read-only references" vibe of the whole endeavor.
I'm not honestly convinced buffet is the optimal way to go about this, but it works for now, it's io_uring and fallback-codepath friendly... ah well.