Crates.io | sync-arena |
lib.rs | sync-arena |
version | 0.1.6 |
created_at | 2025-03-25 12:07:19.174033+00 |
updated_at | 2025-03-26 02:26:49.837309+00 |
description | A simple, thread-safe arena allocator. |
homepage | |
repository | |
max_upload_size | |
id | 1605102 |
size | 47,579 |
The arena, a fast, thread-safe but limited type of allocator.
Arenas are a type of allocator that destroy the objects within, all at once, once the arena itself is destroyed. They do not support deallocation of individual objects while the arena itself is still alive. The benefit of an arena is very fast allocation; just a pointer bump.
This crate implements several kinds of arena.
std-reentrant-lock
: Use unstable std::sync::ReentrantLock
. Requires nightly Rust.lock_api
: Use lock_api
crate for reentrant mutex. Requires lock_api
crate.remutex
: Use remutex
crate for reentrant mutex. Requires remutex
crate.This is a simple implementation of a synchronized arena, which is a data structure that allows multiple threads to concurrently insert elements. The arena is implemented as a linked list of blocks, where each block contains a fixed number of elements. The arena is synchronized using a single reentrant mutex.