|
#define | __ALIGN |
| Defines structure alignment and enforces the target byte order.
|
|
#define | __LIBMEMALLOC_API |
| Defines the default visibility attribute for exported symbols.
|
|
#define | __LIBMEMALLOC_MALLOC |
| Annotates allocator functions that return newly allocated memory.
|
|
#define | __LIBMEMALLOC_REALLOC |
| Annotates reallocator functions that may return a pointer to resized memory.
|
|
#define | PTR_ERR(x) ((void *)((intptr_t)(x))) |
| Encodes a negative error code as an error pointer.
|
|
#define | ALIGN(x) (((x) + (ARCH_ALIGNMENT - 1U)) & ~(ARCH_ALIGNMENT - 1U)) |
| Aligns a given value to the nearest memory boundary.
|
|
#define | GC_INTERVAL_MS (uint16_t)(100U) |
| Default interval in milliseconds between GC cycles.
|
|
|
void * | MEM_memset (void *const source, const int value, const size_t size) |
| Fills a memory block with a specified byte value using optimized operations.
|
|
void * | MEM_memcpy (void *const dest, const void *src, const size_t size) |
| Copies a memory block between buffers using optimized operations.
|
|
int | MEM_allocatorInit (mem_allocator_t *const allocator) |
| Initializes the memory allocator and its internal structures.
|
|
void * | MEM_allocMallocFirstFit (mem_allocator_t *const allocator, const size_t size, const char *const var) |
| Allocates memory using the FIRST_FIT strategy.
|
|
void * | MEM_allocMallocBestFit (mem_allocator_t *const allocator, const size_t size, const char *const var) |
| Allocates memory using the BEST_FIT strategy.
|
|
void * | MEM_allocMallocNextFit (mem_allocator_t *const allocator, const size_t size, const char *const var) |
| Allocates memory using the NEXT_FIT strategy.
|
|
void * | MEM_allocMalloc (mem_allocator_t *const allocator, const size_t size, const char *const var, const allocation_strategy_t strategy) |
| Allocates memory using the specified strategy.
|
|
void * | MEM_allocCalloc (mem_allocator_t *const allocator, const size_t size, const char *const var, const allocation_strategy_t strategy) |
| Allocates and zero‐initializes memory using the specified strategy.
|
|
void * | MEM_allocRealloc (mem_allocator_t *const allocator, void *const ptr, const size_t new_size, const char *const var, const allocation_strategy_t strategy) |
| Reallocates memory with safety checks using the specified strategy.
|
|
int | MEM_allocFree (mem_allocator_t *const allocator, void *const ptr, const char *const var) |
| Releases allocated memory back to the heap.
|
|
int | MEM_enableGc (mem_allocator_t *const allocator) |
| Start or signal the garbage collector thread.
|
|
int | MEM_disableGc (mem_allocator_t *const allocator) |
| Stop the garbage collector thread and perform a final collection.
|
|
Implements memory allocator with advanced features:
- Garbage collection (mark & sweep)
- Multiple allocation strategies (First/Best/Next Fit)
- Version
- v1.0.00
- Date
- 23.08.2025
- Author
- Rafael V. Volkmer rafae.nosp@m.l.v..nosp@m.volkm.nosp@m.er@g.nosp@m.mail..nosp@m.com