heap: Make weak declaration for the alloc and free callbacks

- Fix "test get allocated size"
- Add tests for the free / alloc hooks
- Call alloc function hook on malloc/realloc/calloc base functions
- Add caps parameter to the allocation hook function
This commit is contained in:
Guillaume Souchere
2023-02-21 07:37:59 +01:00
committed by Mahavir Jain
parent 1588c61c7b
commit 5a1f0cd63c
4 changed files with 108 additions and 101 deletions

View File

@@ -370,7 +370,7 @@ multi_heap_handle_t multi_heap_register(void *start, size_t size)
return multi_heap_register_impl(start, size);
}
static inline void subtract_poison_overhead(size_t *arg) {
static inline __attribute__((always_inline)) void subtract_poison_overhead(size_t *arg) {
if (*arg > POISON_OVERHEAD) {
*arg -= POISON_OVERHEAD;
} else {