docs/Writerside/topics/memory.md

Sat, 15 Mar 2025 22:58:51 +0100

author
Mike Becker <universe@uap-core.de>
date
Sat, 15 Mar 2025 22:58:51 +0100
changeset 1247
e30d38e06559
parent 1210
2ad0cf0f314b
permissions
-rw-r--r--

fix warning in test case due to C23 multibyte strings not being compatible with const char*

# Memory Management

With the `CxAllocator` interface UCX provides the possibility to use custom allocator functions for different purposes.
Many UCX functions support the use of specialized allocators or provide a second function suffixed with `_a`.

For convenience, functions that are not explicitly requesting an allocator - like e.g. `cx_strdup_a()` - also accept
`NULL` as an allocator, in which case the `cxDefaultAllocator` and stdlib functions are used.

Additionally, UCX also provides a [memory pool](mempool.h.md) implementation of the allocator interface.

> Although not part of the public API, UCX is also implementing the allocator interface
> in its own test suite: `CxTestingAllocator`. This allocator keeps track of memory allocations
> and deallocations with the goal to detect memory management errors.  

mercurial