C layer of the Memory module: allocations tracked by the memory manager, a pool or arena per tag, and standalone arenas and pools.
The manager is 'Memory::CMemoryManager' of 'ethereal/cpp/memory/manager.hpp', one per process. It records every allocation (size, tag, file and line) and gives the text reports of statistics and pending allocations.
Lifetime: the manager is never destroyed, so a static object that frees through it at exit still finds it. Its pools and arenas are not returned on their own. A module loaded and unloaded many times (a plugin) calls ETLC_MemoryShutdown before the unload, after it stopped allocating.
A tag with no policy allocates from the heap. With a policy (ETLC_MemoryCreatePolicy) the allocations of the tag come from its pool or arena, with the alignment of the policy.
Standalone arenas and pools are handles of their own, outside the manager. An arena only grows (bump allocation): a free clears the block and keeps it, and memory comes back with ETLC_MemoryArenaReset or ETLC_MemoryArenaFreeToMarker. A pool reuses freed blocks.
Freeing a pointer that did not come from the same manager, arena or pool, or freeing it twice, is undefined behavior. The C++ side does not detect it.
Text output always ends in '\0'. The size written does not count it. When the buffer is too small, the call writes the capacity needed (text plus '\0'), so 'uCap = 0' asks for it.
Every export returns 'int'. Zero is success, negative is an error. The values are part of the ABI.