std1.0.0-beta-7 SafeC docs

std :: crypto::secure_alloc

Struct std::SecureAllocator

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

struct SecureAllocator {
    struct SlabAllocator slab;
}

Fields

underlying slab

Methods

§static struct SecureAllocator new(unsigned long obj_size, unsigned long count)source · definition

A secure allocator of count slots of obj_size bytes each (heap-backed, double-free-detecting: SlabAllocator::new).

§?&heap unsigned char alloc(unsigned long size, unsigned long align)source · definition

One slot for size bytes aligned to align (a power of two; 0 is taken as 1). null when every slot is in use, size > obj_size, or align is above slab.max_align() (at most 8).

§void dealloc(?&heap unsigned char ptr)source · definition

Zero and free an object slot (null: no-op).

§unsigned long available() constsource · definition

Return number of available slots.

§void drop()source · definition

Zero all memory and destroy the backing buffer.

§void destroy() consumesource · definition

= drop()