1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//! The Talc allocator crate.
//!
//! For getting started:
//! - Check out the crate's [README](https://github.com/SFBdragon/talc)
//! - Read check out the `Talc` and `Talck` structures.
//!
//! Your first step will be `Talc::new(...)`, then `claim`.
//! Calling `Talc::lock()` on it will yield a `Talck` which implements
//! [`GlobalAlloc`] and [`Allocator`] (if the appropriate feature flags are set).

#![cfg_attr(not(any(test, fuzzing)), no_std)]
#![cfg_attr(feature = "allocator", feature(allocator_api))]
#![cfg_attr(feature = "nightly_api", feature(slice_ptr_len))]
#![cfg_attr(feature = "nightly_api", feature(const_slice_ptr_len))]

mod oom_handler;
mod ptr_utils;
mod span;
mod talc;

#[cfg(feature = "lock_api")]
pub mod locking;
#[cfg(feature = "lock_api")]
mod talck;

pub use oom_handler::{ClaimOnOom, ErrOnOom, OomHandler};
pub use span::Span;
pub use talc::Talc;

#[cfg(feature = "lock_api")]
pub use talck::Talck;
#[cfg(all(target_family = "wasm", feature = "lock_api"))]
pub use talck::TalckWasm;

#[cfg(all(target_family = "wasm", feature = "lock_api"))]
pub use oom_handler::WasmHandler;