-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Milestone
Description
I came across a case where we wanted to add custom memory debug/tracking code for malloc. Since pico sdk already wraps malloc we need a way of calling our code from the wrapped pico version of malloc. I had 2 ideas to accomplish this.
- Add CMAKE switch to turn off building of pico_malloc so user could implement wrap functions on their own.
- Create new PICO_REDIRECT_MALLOC define, if enabled it would replace REAL_FUNC, with REDIRECT_MALLOC_FUNC.
My preference is option 2 as it allows user to still get the functionally in the pico_malloc wrapped functions and just extend it with more functionality.
I have my suggested changes at JNTeledyne@399cdae
Another good use of this is if someone wanted to have fun and implement a slab allocator or write their own version of malloc.
Metadata
Metadata
Assignees
Labels
No labels