Adding Memory Tagging to a Dynamic Memory Allocator
Review frequently asked questions
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.
Edit
heap.c and heap.h for allocator changes and mte_utils.c and mte_utils.h for tag helper logic. Use main.c to exercise the allocator and drive specific scenarios.Add calls in
main.c to the example functions and rebuild the project. Each function triggers a scenario so you can observe how the MTE-enabled allocator responds.Verify that process and heap initialization that enables tagged addresses runs before any allocations. Also confirm that the example functions are called from
main.c.On access, MTE compares the pointer’s logical tag with the memory’s allocation tag and raises an exception if they differ. The demo scenarios are designed to make this behavior visible.
The initialization sets synchronous tag checking. Apply this configuration when enabling tagged addresses for the process.