mirror of
https://github.com/bspeice/qadapt
synced 2024-11-24 23:08:11 -05:00
Slight docs update
This commit is contained in:
parent
daabd22dc7
commit
79f57ba2f9
@ -152,9 +152,10 @@ fn escape_return(ts: TokenStream) -> TokenStream {
|
|||||||
/// Set up the QADAPT allocator to trigger a panic if any allocations happen during
|
/// Set up the QADAPT allocator to trigger a panic if any allocations happen during
|
||||||
/// calls to this function.
|
/// calls to this function.
|
||||||
///
|
///
|
||||||
/// QADAPT will only track allocations in the thread that calls this function;
|
/// QADAPT will only track allocations in the current function call;
|
||||||
/// if (for example) this function receives the results of an allocation in a
|
/// if (for example) this function receives the results of an allocation in a
|
||||||
/// separate thread, QADAPT will not trigger a panic.
|
/// separate thread, or defers allocations via closure/Future, those results
|
||||||
|
/// will not trigger an error.
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
pub fn allocate_panic(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
pub fn allocate_panic(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||||
let mut protected_fn: Vec<TokenTree> = Vec::new();
|
let mut protected_fn: Vec<TokenTree> = Vec::new();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
//! The Quick And Dirty Allocation Profiling Tool
|
//! # The Quick And Dirty Allocation Profiling Tool
|
||||||
//!
|
//!
|
||||||
//! This allocator is a helper for writing high-performance code that is allocation/drop free;
|
//! This allocator is a helper for writing high-performance code that is allocation/drop free;
|
||||||
//! for functions annotated with `#[allocate_panic]`, QADAPT will detect when allocations/drops
|
//! for functions annotated with `#[allocate_panic]`, QADAPT will detect when allocations/drops
|
||||||
//! happen during their execution (and execution of any functions they call) and throw a
|
//! happen during their execution (and execution of any functions they call) and throw a
|
||||||
//! thread panic if this occurs. QADAPT-related code is stripped out during release builds,
|
//! thread panic if this occurs. QADAPT-related code is *stripped out during release builds*,
|
||||||
//! so no worries about random allocations crashing in production.
|
//! so no worries about random allocations crashing in production.
|
||||||
//!
|
//!
|
||||||
//! Currently this crate is Nightly-only, but will work once `const fn` is in Stable.
|
//! Currently this crate is Nightly-only, but will work once `const fn` is in Stable.
|
||||||
|
Loading…
Reference in New Issue
Block a user