multitude 0.5.1

Fast and flexible arena allocator.
Documentation
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

[package]
name = "multitude"
version = "0.5.1"
description = "Fast and flexible arena allocator."
readme = "README.md"
keywords = ["arena", "memory", "allocator", "bump"]
categories = ["memory-management", "data-structures"]

edition = { workspace = true }
rust-version = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
homepage = { workspace = true }
include = { workspace = true }
repository = "https://github.com/microsoft/oxidizer/tree/main/crates/multitude"

[package.metadata.cargo_check_external_types]
allowed_external_types = [
    "allocator_api2::*",
    "bytemuck::*",
    "bytesbuf::*",
    "hashbrown::*",
    "ptr_meta::*",
    "ptr_meta_derive::*",
    "serde::*",
    "serde_core::*",
    "widestring::*",
    "zerocopy::*",
]

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
all-features = true

[features]
default = ["std"]
std = []
serde = ["dep:serde"]
stats = []
dst = ["ptr_meta/derive"]
utf16 = ["dep:widestring"]
bytes = ["dep:bytes"]
bytemuck = ["dep:bytemuck", "dst"]
bytesbuf = ["dep:bytesbuf", "std"]
zerocopy = ["dep:zerocopy", "dst"]
hashbrown = ["dep:hashbrown"]

[dependencies]
allocator-api2 = { workspace = true, features = ["alloc"] }
# Legacy `allocator-api2` 0.2 line, used by hashbrown (and other crates) that
# have not yet migrated to the modern API. `&Arena` implements *both* this and
# the 0.4 `Allocator` trait so it can back hashbrown collections directly.
allocator-api2-02 = { package = "allocator-api2", version = "0.2", default-features = false, features = ["alloc"] }
bytemuck = { workspace = true, features = ["derive"], optional = true }
bytes = { workspace = true, optional = true }
bytesbuf = { workspace = true, optional = true }
hashbrown = { workspace = true, features = ["allocator-api2", "default-hasher"], optional = true }
ptr_meta = { workspace = true }
serde = { workspace = true, optional = true }
widestring = { workspace = true, features = ["alloc"], optional = true }
zerocopy = { workspace = true, optional = true }

# Loom is only used under `--cfg loom` for the model-checked tests.
# `target.'cfg(loom)'` is matched by Cargo when `RUSTFLAGS="--cfg loom"` is set.
[target.'cfg(loom)'.dependencies]
loom = { workspace = true }

[dev-dependencies]
alloc_tracker = "0.6"
allocator-api2 = { workspace = true, features = ["alloc"] }
bolero = { workspace = true, features = ["std"] }
# `std` transitively enables `bolero-engine/any`, which is required
# because bolero-libfuzzer 0.13.0 references `bolero_engine::any::run`
# but does not itself activate that feature on `bolero-engine`.
bumpalo = { workspace = true, features = ["collections"] }
criterion = { workspace = true }
mimalloc = { workspace = true }
mutants = { workspace = true }
serde_json = { workspace = true }

[target.'cfg(loom)'.dev-dependencies]
loom = { workspace = true }

# Workspace dep declares `default-features = false`; we re-enable `default` here
# (which pulls in the `benchmark` feature with `library_benchmark`,
# `library_benchmark_group!`, and `gungraun::main!`) only on Linux.
[target.'cfg(target_os = "linux")'.dev-dependencies]
gungraun = { workspace = true, features = ["default"] }

[lints]
workspace = true

[[bench]]
name = "criterion_alloc"
harness = false

[[bench]]
name = "criterion_drop"
harness = false

[[bench]]
name = "criterion_arc_array"
harness = false

[[bench]]
name = "criterion_rc_array"
harness = false

[[bench]]
name = "criterion_arena_vs_allocator"
harness = false

# Callgrind benches require Linux (Valgrind). The bench files are gated to compile
# to a no-op on non-Linux targets, but the [[bench]] entry itself cannot be
# cfg-gated, so it is unconditional here.
[[bench]]
name = "gungraun_alloc"
harness = false

[[bench]]
name = "gungraun_drop"
harness = false

[[bench]]
name = "gungraun_arc_array"
harness = false

[[bench]]
name = "gungraun_rc_array"
harness = false

[[example]]
name = "multitude_basic"

[[example]]
name = "strings"