tern.memory

General-purpose memory optimized memory utilities. For memory management, see tern.typecons.automem.

Members

Functions

calloc
void* calloc(size_t size)

Allocates an entry of size and clears the entry.

ctz
size_t ctz(size_t mask)

Counts the number of trailing zeroes in DIR direction in mask.

free
bool free(void* ptr)

Frees ptr, self explanatory.

malloc
void* malloc(size_t size)

Allocates an entry of size

memchr
size_t memchr(void* src, size_t len, T elem)

Finds the index of elem in src within 0..len using SIMD intrinsics.

realloc
void realloc(void* ptr, size_t size)

Reallocates ptr with size Tries to avoid actually doing a new allocation if possible.

reference
void* reference()

Creates a reference to V instance data.

wake
void wake(void* ptr)

Zeroes the entry pointed to by ptr.

Static functions

byteswap
void byteswap(void* src, size_t len)

Swaps all bytes at src from 0..len.

emplace
void emplace(T* ptr)
Undocumented in source. Be warned that the author may not have intended to support it.
memcpy
void memcpy(void* src, void* dst, size_t len)
void memcpy(void* src, void* dst)

Copies all data from src to dst within range 0..len.

memzero
void memzero(void* src, size_t len)

Zeroes all bytes at src within range 0..len.

Meta