parity-util-mem 0.12.0

Collection of memory related utilities
Documentation
[package]
name = "parity-util-mem"
version = "0.12.0"
authors = ["Parity Technologies <admin@parity.io>"]
repository = "https://github.com/paritytech/parity-common"
description = "Collection of memory related utilities"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.56.1"

# Prevent multiple versions from being linked into the same program.
links = "parity-util-mem-ban-duplicates"
# `links` requires a build script to be present:
# https://doc.rust-lang.org/cargo/reference/build-scripts.html#the-links-manifest-key
# so we use an empty build script
build = "build.rs"

[dependencies]
cfg-if = "1.0.0"
dlmalloc = { version = "0.2.1", features = ["global"], optional = true }
lru = { version = "0.8", optional = true }
hashbrown = { version = "0.12", optional = true }
mimalloc = { version = "0.1.18", optional = true }
libmimalloc-sys = { version = "0.1.14", optional = true }
parity-util-mem-derive = { path = "derive", version = "0.1" }
impl-trait-for-tuples = "0.2.0"

smallvec = { version = "1.0.0", optional = true }
ethereum-types = { version = "0.14.0", optional = true, path = "../ethereum-types" }
parking_lot = { version = "0.12.0", optional = true }
primitive-types = { version = "0.12", path = "../primitive-types", default-features = false, optional = true }

[target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0.3.8", features = ["heapapi"] }

[target.'cfg(not(target_os = "windows"))'.dependencies.tikv-jemallocator]
version = "0.5.0"
optional = true

[target.'cfg(not(target_os = "windows"))'.dependencies.tikv-jemalloc-ctl]
version = "0.5.0"
optional = true

[features]
default = ["std", "ethereum-impls", "lru", "hashbrown", "smallvec", "primitive-types"]
std = ["parking_lot"]
# use dlmalloc as global allocator
dlmalloc-global = ["dlmalloc", "estimate-heapsize"]
# use jemalloc as global allocator
jemalloc-global = ["tikv-jemallocator", "tikv-jemalloc-ctl"]
# use mimalloc as global allocator
mimalloc-global = ["mimalloc", "libmimalloc-sys"]
# implement additional types
ethereum-impls = ["ethereum-types", "primitive-types"]
# Full estimate: no call to allocator
estimate-heapsize = []