sync-arena 0.2.0

A simple, thread-safe arena allocator.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
**Borrowed from [rustc_arena](https://doc.rust-lang.org/stable/nightly-rustc/rustc_arena/index.html), and its license is copied to [COPYRIGHT-RUST](./COPYRIGHT-RUST)**. We also made some modifications to make the arena `Sync` safely.

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.