diff options
Diffstat (limited to 'libs/libc/inc/mem.h')
-rw-r--r-- | libs/libc/inc/mem.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/libc/inc/mem.h b/libs/libc/inc/mem.h index de2a84f..63a1b14 100644 --- a/libs/libc/inc/mem.h +++ b/libs/libc/inc/mem.h @@ -5,12 +5,16 @@ #include <def.h> -void *malloc_debug(u32 size, const char *file, int line, const char *func, const char *inp) NONNULL; +ATTR((malloc)) +ATTR((alloc_size(1))) +RET_NONNULL void *malloc_debug(u32 size, const char *file, int line, const char *func, + const char *inp) NONNULL; +ATTR((malloc)) ATTR((alloc_size(2))) RET_NONNULL void *realloc(void *ptr, u32 size); +ATTR((malloc)) ATTR((alloc_size(1))) RET_NONNULL void *zalloc(u32 size); void free_debug(void *ptr, const char *file, int line, const char *func, const char *inp) NONNULL; + #define malloc(size) malloc_debug((u32)(size), __FILE__, __LINE__, __func__, #size) #define free(ptr) free_debug((void *)(ptr), __FILE__, __LINE__, __func__, #ptr) -void *realloc(void *ptr, u32 size); -void *zalloc(u32 size); #ifdef KERNEL #define STACK_START 0x00500000 // Defined in bootloader |