Skip to main content

xmlGcMemSetup

Function xmlGcMemSetup 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn xmlGcMemSetup( freeFunc: Option<xmlFreeFunc>, mallocFunc: Option<xmlMallocFunc>, reallocFunc: Option<xmlReallocFunc>, strdupFunc: Option<xmlStrdupFunc>, )
Expand description

Set GC-aware memory allocator functions.

§UPSTREAM-PARITY

This is a wrapper around xmlMemSetup in modern libxml2. Historically, it was separate for the GC-allocated memory pool, but in modern versions both functions do the same thing.

§SAFETY

  • freeFunc, mallocFunc, reallocFunc, strdupFunc must be a valid callback (or None); the callback is invoked with the documented context pointer and must itself uphold the same pointer invariants.

The caller must not race this call with concurrent mutation of the same objects from other threads (per-object state is not internally synchronized). Violating any of the above is undefined behavior.

Exercised by the C-API differential courts (courts/suites/data-abi/*-family-probe.c) and the CLI differential courts; those pass byte-for-byte against the upstream oracle.