A high-performance, deterministic memory allocator with O(1) operations and low fragmentation for embedded and real-time systems.
TLSF is a memory allocator implementation specifically designed for real-time and embedded systems. It solves the problem of unpredictable memory allocation timing by providing O(1) time complexity for all operations while maintaining extremely low overhead and fragmentation.
Embedded systems developers, real-time application programmers, and anyone working on systems where deterministic memory allocation behavior is required.
Developers choose TLSF for its guaranteed O(1) performance, minimal memory overhead, and low fragmentation characteristics, making it superior to general-purpose allocators for time-critical applications.
Two-Level Segregated Fit memory allocator implementation.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides constant-time malloc, free, realloc, and memalign operations, as stated in the README, ensuring predictable timing critical for real-time systems.
Each allocation adds only 4 bytes of overhead, and pool management requires about 3kB, keeping footprint low for embedded environments.
Efficient memory organization reduces wasted space, which is explicitly highlighted as a key feature to minimize fragmentation.
Compiles to just a few kilobytes of code and data, making it suitable for resource-constrained systems per the README.
Supports adding and removing memory pool regions at runtime, allowing flexible memory allocation as described in the features.
The README explicitly states it is not designed to be thread-safe, requiring users to implement synchronization, adding complexity for multi-threaded apps.
Assumes 4-byte aligned accesses, which may not hold for all embedded systems, potentially limiting portability without modifications.
Historical updates, like v3.0, introduced interface changes that could break existing code, indicating potential instability in future versions.
Optimized for real-time and embedded use, so it may underperform or be overkill for general-purpose applications with different needs.