Skip to main content

Crate memory

Crate memory 

Source
Expand description

Shared memory allocator for the krypteia cryptographic workspace.

This crate provides a single GlobalAlloc that both arcana_ffi and quantica_ffi use when running on targets without an OS heap.

§Feature flags

FeatureBehaviour
os-allocThe platform provides malloc/free. Init is a no-op.
self-allocTLSF allocator over a caller-provided RAM block.

Enable exactly one of the two features. os-alloc is the default.

§Usage from C (bare-metal)

#include "krypteia.h"

static uint8_t heap[8192];

int main(void) {
    krypteia_init(heap, sizeof(heap));
    // … use arcana or quantica APIs …
}

Structs§

MemStats
Memory allocation statistics.

Functions§

krypteia_init
No-op when the OS provides its own allocator.
memory_stats
Returns zeroed stats in os-alloc mode (the OS tracks its own heap; we have no visibility).