Skip to content
AllocatorRealloc_dyn

AllocatorRealloc_dyn

Description

Convenience cascade: tries AllocatorResize first; on failure falls back to AllocatorRemap. The realloc-shaped entry point that’s been in the API since v1 – semantics unchanged, but callers that need the in-place guarantee should now use AllocatorResize directly.

Success

Returns the (possibly moved) pointer, or NULL when new_size is zero.

Failure

Returns NULL when reallocation fails.

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    void *AllocatorRealloc_dyn(Allocator *self, void *ptr, size new_size) {
        // Convenience cascade: try in-place first (cheap if the allocator
        // can do it -- no copy, no free, pointer stays valid), fall back
Last updated on