std1.0.0-beta-7 SafeC docs

Module crypto::secure_alloc

#include <std/crypto/secure_alloc.h> source

Secure Allocator Zeroes memory on free to prevent heap inspection / data remanence. Uses a slab allocator so object sizes are fixed — no fragmentation metadata can leak size information. Conforms to Allocator (std/alloc/allocator.h): typed allocation is alloc_t / dealloc_t there, and the zeroing on dealloc applies to them too.

struct SecureAllocator sa = std::SecureAllocator::new(32UL, 4UL);
?&heap Key k = std::alloc_t(&sa);   // null if sizeof(Key) > 32 or full
...
std::dealloc_t(&sa, k);             // zeroed, then back on the free list
sa.destroy();                       // zeroes every slot, frees the buffer

Structs

SecureAllocator