diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2023-11-26 22:01:42 -0300 |
|---|---|---|
| committer | Eblo <7004497+Eblo@users.noreply.github.com> | 2025-09-12 16:56:20 -0400 |
| commit | e47a7050faf345ab2f220bfce58effd2590b9e5e (patch) | |
| tree | 42b239f299eb1d5180a1d1a5b3b7c1d69cfe4576 /mm/src/boot/O2/system_malloc.c | |
| parent | 56dac034b3b33fd4d3b4f0c3d35e50bd69b62dbe (diff) | |
Organize `libc64` files (#1492)
* Move qrand to libc64
* use an union to avoid type punning
* __osMalloc
* math64.c
* fixed_point.h
* sleep
* aprintf.h
* sprintf
* malloc
* use original names on aprintf.c and malloc.c
* qrand cleanup pass
* use original names of sleep.c
* og names for sprintf
* more cleanup
* format
* fixes
* whoops
* use ARRAY_COUNT again
* comment
* Use `fu`
* forgot this one
* review
* fix
* sneak a tiny cleanup
Diffstat (limited to 'mm/src/boot/O2/system_malloc.c')
| -rw-r--r-- | mm/src/boot/O2/system_malloc.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/mm/src/boot/O2/system_malloc.c b/mm/src/boot/O2/system_malloc.c deleted file mode 100644 index e41c11df9..000000000 --- a/mm/src/boot/O2/system_malloc.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "global.h" -#include "os_malloc.h" -#include <string.h> - -Arena gSystemArena; - -void* SystemArena_Malloc(size_t size) { - return __osMalloc(&gSystemArena, size); -} - -void* SystemArena_MallocR(size_t size) { - return __osMallocR(&gSystemArena, size); -} - -void* SystemArena_Realloc(void* oldPtr, size_t newSize) { - return __osRealloc(&gSystemArena, oldPtr, newSize); -} - -void SystemArena_Free(void* ptr) { - __osFree(&gSystemArena, ptr); -} - -void* SystemArena_Calloc(size_t num, size_t size) { - void* ptr; - size_t totalSize = num * size; - - ptr = __osMalloc(&gSystemArena, totalSize); - if (ptr != NULL) { - memset(ptr, 0, totalSize); - } - return ptr; -} - -void SystemArena_GetSizes(size_t* maxFreeBlock, size_t* bytesFree, size_t* bytesAllocated) { - __osGetSizes(&gSystemArena, maxFreeBlock, bytesFree, bytesAllocated); -} - -u32 SystemArena_CheckArena(void) { - return __osCheckArena(&gSystemArena); -} - -void SystemArena_Init(void* start, size_t size) { - __osMallocInit(&gSystemArena, start, size); -} - -void SystemArena_Cleanup(void) { - __osMallocCleanup(&gSystemArena); -} - -u8 SystemArena_IsInitialized(void) { - return __osMallocIsInitalized(&gSystemArena); -} |
