25#define VL_KB(x) ((vl_memsize_t) (x) << 10)
33#define VL_MB(x) ((vl_memsize_t) (x) << 20)
36#ifndef VL_DEFAULT_MEMORY_SIZE
40#define VL_DEFAULT_MEMORY_SIZE VL_KB(1)
43#ifndef VL_DEFAULT_MEMORY_ALIGN
47#define VL_DEFAULT_MEMORY_ALIGN alignof(vl_ularge_t)
50#ifndef VL_MEMORY_PAD_UP
60#define VL_MEMORY_PAD_UP(len, pad) (vl_ularge_t)((len) + ((len) % (pad)))
234#define vlMemReverse(src, numBytes) \
235 vlMemReverseSubArraysStride(src, 1, numBytes, 1)
238#ifndef vlMemReverseSubArrays
258#define vlMemReverseSubArrays(src, elementSize, numElements) \
259 vlMemReverseSubArraysStride(src, elementSize, elementSize, numElements)
vl_int_t(* vl_compare_function)(const void *dataA, const void *dataB)
Definition vl_compare.h:18
void vlMemReverseSubArraysStride(void *src, vl_dsoffs_t srcStride, vl_memsize_t elementSize, vl_dsidx_t numElements)
Reverses the bytes in a series of elements of a defined length and stride between them.
Definition vl_memory.c:199
vl_memory * vlMemAllocAligned(vl_memsize_t allocSize, vl_uint_t align)
Allocates a block of memory with an alignment.
Definition vl_memory.c:52
vl_uint_t vlMemAlignment(vl_memory *mem)
Returns the alignment of the specified block of memory.
Definition vl_memory.c:220
void vlMemSort(void *buffer, vl_memsize_t elementSize, vl_dsidx_t numElements, vl_compare_function comparator)
Sorts the specified buffer in-place according to the specified element and comparator function.
Definition vl_memory.c:166
vl_memory * vlMemRealloc(vl_memory *mem, vl_memsize_t allocSize)
Reallocates the specified block of memory to hold the specified total number of bytes.
Definition vl_memory.c:73
vl_memory * vlMemAlloc(vl_memsize_t allocSize)
Attempts to allocate a block of memory.
Definition vl_memory.c:39
vl_memsize_t vlMemSize(vl_memory *mem)
Returns the size (in total number of bytes) of the specified block of vl_memory.
Definition vl_memory.c:224
void vlMemCopyStride(const void *src, vl_dsoffs_t srcStride, void *dest, vl_dsoffs_t dstStride, vl_memsize_t elementSize, vl_dsidx_t numElements)
Copies data from one buffer to another, with a stride applied to both.
Definition vl_memory.c:183
vl_memory * vlMemClone(vl_memory *mem)
Clones the specified block of memory, returning a pointer to its new clone.
Definition vl_memory.c:106
VL_MEMORY_SIZE_T vl_memsize_t
Definition vl_memory.h:18
VL_MEMORY_T vl_memory
Definition vl_memory.h:76
VL_MEMORY_T vl_transient
Definition vl_memory.h:85
void vlMemFree(vl_memory *mem)
Frees the specified block of memory.
Definition vl_memory.c:228
VL_UINT_T vl_uint_t
Standard unsigned integer type.
Definition vl_numtypes.h:96
VL_STRUCTURE_INDEX_T vl_dsidx_t
Index type for data structures.
Definition vl_numtypes.h:13
VL_STRUCTURE_OFFSET_T vl_dsoffs_t
Byte offset type for data structures.
Definition vl_numtypes.h:8