Explore related resources

Find more information about the topics in this Learning Path:

Give feedback

How would you rate this Learning Path?

Review frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
Which files do I edit to implement the allocator?
Put the implementation in heap.c and the declarations in heap.h. The test program that calls your functions is in main.c, and CMakeLists.txt configures the build.
How do I confirm the test program calls my `simple_malloc` and `simple_free`?
Check that main.c includes heap.h and uses simple_malloc and simple_free. You can also add temporary logging or assertions in heap.c to verify the call flow during a test run.
What should I check if `simple_malloc` returns `NULL` for a small request?
Verify the requested size and confirm your allocator is initialized before the first request. Ensure your implementation handles allocation failure paths correctly and that the test code checks for NULL before using the returned pointer.
Do I need to replace the C library `malloc` and `free`?
No. You’ll use separate functions named simple_malloc and simple_free and won’t replace the C library allocator.
How can I sanity-check that `simple_free` works before moving on?
Run sequences that allocate, free, and then allocate again to see if subsequent requests succeed without errors. Add basic checks or prints in main.c and heap.c to confirm that block metadata and returned pointers behave as expected.

Share

Tell others about this Learning Path.