# Adding Memory Tagging to a Dynamic Memory Allocator

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/laptops-and-desktops/memory-tagged-dynamic-memory-allocator/)
- [Why Use Memory Tagging?](https://learn.arm.com/learning-paths/laptops-and-desktops/memory-tagged-dynamic-memory-allocator/how-to-1/)
- [Implement Memory Tagging for a Dynamic Memory Allocator](https://learn.arm.com/learning-paths/laptops-and-desktops/memory-tagged-dynamic-memory-allocator/how-to-2/)
- [Memory Tagging Changes](https://learn.arm.com/learning-paths/laptops-and-desktops/memory-tagged-dynamic-memory-allocator/how-to-3/)
- [Preventing Mistakes By Using Memory Tagging](https://learn.arm.com/learning-paths/laptops-and-desktops/memory-tagged-dynamic-memory-allocator/how-to-4/)
- [Memory Tagged Allocation Summary](https://learn.arm.com/learning-paths/laptops-and-desktops/memory-tagged-dynamic-memory-allocator/how-to-5/)
- [Next Steps](https://learn.arm.com/learning-paths/laptops-and-desktops/memory-tagged-dynamic-memory-allocator/_next-steps/)

## About this Learning Path

|  |  |
| --- | --- |
| Skill level: | Advanced |
| Reading time: | 2 hrs |
| Last updated: | 29 Jul 2026 |

|  |  |
| --- | --- |
| Author: | David Spickett , Arm |
| Arm IP: | [Cortex-A](https://support.arm.com/?tab=compute-ip&Product%20Type=Application%20Processors) |
| Tags: | [Performance and Architecture](https://learn.arm.com/tag/performance-and-architecture/) [Linux](https://learn.arm.com/tag/linux) [MTE](https://learn.arm.com/tag/mte) [Linux](https://learn.arm.com/tag/linux) [C](https://learn.arm.com/tag/c) |

### Who is this for?
This is an advanced topic for software developers who want to learn how to use the Memory Tagging Extension (MTE) to protect dynamic memory allocations.

### What will you learn?
After completing this Learning Path, you'll be able to perform the following tasks:

- Learn how to apply MTE to an existing memory allocator
- Understand how MTE can prevent common memory use errors

### Prerequisites
Before starting, you'll need the following prerequisites:

- A Linux computer.
- Basic knowledge of how MTE works. Refer to the [Learn about Memory Tagging Extension Learning Path](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/mte/).
- Knowledge of how a dynamic memory allocator can be implemented. Refer to the [Write a Dynamic Memory Allocator Learning Path](https://learn.arm.com/learning-paths/cross-platform/dynamic-memory-allocator/).

### Summary
You’ll add Arm MTE checks to a Linux dynamic memory allocator. You’ll enable tagged addresses and synchronous checking, update the allocator and tag helpers, and run misuse examples that trigger mismatches. You’ll trace tag setup and checks across `heap.c`, `heap.h`, `mte_utils.c`, `mte_utils.h`, and `main.c`, then inspect the resulting exceptions.
