Memory Manager main header.
More...
#include <log/log.h>
#include <arch/mem.h>
#include <core/core.h>
#include <stddef.h>
#include <stdlib.h>
Go to the source code of this file.
|
static void * | mm_aligned_alloc (size_t alignment, size_t mem_size) |
| A version of the stdlib aligned_alloc() used internally. More...
|
|
static void | mm_aligned_free (void *ptr) |
| A version of the stdlib free() for aligned blocks used internally. More...
|
|
static void * | mm_alloc (size_t mem_size) |
| A version of the stdlib malloc() used internally. More...
|
|
static void * | mm_realloc (void *ptr, size_t mem_size) |
| A version of the stdlib realloc() used internally. More...
|
|
static void | mm_free (void *ptr) |
| A version of the stdlib free() used internally. More...
|
|
Memory Manager main header.
Memory Manager main header
- Copyright
- Copyright (C) 2008-2022 HPDCS Group https://hpdcs.github.io
◆ mm_aligned_alloc()
static void* mm_aligned_alloc |
( |
size_t |
alignment, |
|
|
size_t |
mem_size |
|
) |
| |
|
inlinestatic |
A version of the stdlib aligned_alloc() used internally.
- Parameters
-
alignment | the requested alignment value in bytes |
mem_size | the size of the requested memory allocation |
- Returns
- a pointer to the newly allocated memory area
In case of memory allocation failure, a logger message is taken and the simulation is promptly aborted
◆ mm_aligned_free()
static void mm_aligned_free |
( |
void * |
ptr | ) |
|
|
inlinestatic |
A version of the stdlib free() for aligned blocks used internally.
- Parameters
-
ptr | a pointer to the memory area to free |
Needed because Windows has a separate function to handle the release of memory allocated with its non standard _aligned_malloc()
◆ mm_alloc()
static void* mm_alloc |
( |
size_t |
mem_size | ) |
|
|
inlinestatic |
A version of the stdlib malloc() used internally.
- Parameters
-
mem_size | the size of the requested memory allocation |
- Returns
- a pointer to the newly allocated memory area
In case of memory allocation failure, a logger message is taken and the simulation is promptly aborted
◆ mm_free()
static void mm_free |
( |
void * |
ptr | ) |
|
|
inlinestatic |
A version of the stdlib free() used internally.
- Parameters
-
ptr | a pointer to the memory area to free |
◆ mm_realloc()
static void* mm_realloc |
( |
void * |
ptr, |
|
|
size_t |
mem_size |
|
) |
| |
|
inlinestatic |
A version of the stdlib realloc() used internally.
- Parameters
-
ptr | a pointer to the memory area to reallocate |
mem_size | the new size of the memory allocation |
- Returns
- a pointer to the newly allocated memory area
In case of memory allocation failure, a logger message is taken and the simulation is promptly aborted