Skip to main content

ddwaf_monotonic_allocator_init

Function ddwaf_monotonic_allocator_init 

Source
pub unsafe extern "C" fn ddwaf_monotonic_allocator_init() -> ddwaf_allocator
Expand description

Creates a monotonic (growing) allocator. Allocations are fast and never freed individually; all memory is reclaimed only when the allocator is destroyed. This allocator must not be used concurrently from multiple threads unless externally synchronized.

Lifetime and safety:

  • Objects allocated from this allocator remain valid until the allocator is destroyed; individual frees have no effect.
  • The allocator must not be destroyed while any memory obtained from it is still in use; doing so will invalidate outstanding pointers.

@return Allocator handle.