Crates.io | tmfalloc |
lib.rs | tmfalloc |
version | 1.0.1 |
source | src |
created_at | 2023-10-06 14:01:55.56865 |
updated_at | 2024-02-17 11:30:33.532356 |
description | Transactional memory-mapped file allocator |
homepage | |
repository | https://gitflic.ru/project/vvoznesensky/tmfalloc |
max_upload_size | |
id | 995145 |
size | 78,802 |
Transactional memory-mapped file allocator inspired by POST++. Allows to merge data representation and storage tiers into one tier. May be used as fixed-schema client cache, embedded application data storage, etc.
std::alloc::Allocator
trait, so usual std::collections::*
(except Hash*
), std::boxed::Box
, etc. containers could be stored in and
retreived from the file.Root
type generic parameter to
store all application-specific parameters, collections, etc.flock
-protected, so simultaneous processes access is
possible.O(log(number of free blocks))
(plus possible file operations costs).Holder
in both parent and fork
-ed child
processes.tmfalloc::Allocator::{allocate, deallocate, grow, shrink}
now panic if
the current thread has not opened a write transation for the appropriate
storage address space. This is to hopefully prevent possible misuse of leaked
allocators.tests::allocator_leak_should_panic
to test for this panic.mlock
-ing instead of log file immediate fsync
in signal
handler to increase write throughput and decrease latency.Apache License v2.0 or MIT License
Vladimir Voznesenskiy <vvoznesensky@yandex.ru>. Looking for a Rust job.
Feedback is welcome. Please, send me an email, if you need more tests, etc.