sync-arena

Crates.iosync-arena
lib.rssync-arena
version0.1.6
created_at2025-03-25 12:07:19.174033+00
updated_at2025-03-26 02:26:49.837309+00
descriptionA simple, thread-safe arena allocator.
homepage
repository
max_upload_size
id1605102
size47,579
Sirui Qu (stuuupidcat)

documentation

README

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.

Features

  • 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.

Synchronized Arena

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.

Commit count: 0

cargo fmt