Skip to content

sysprog21/tlsf-bsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tlsf-bsd: Two-Level Segregated Fit Memory Allocator

Two-Level Segregated Fit memory allocator implementation derived from the BSD-licensed implementation by Matthew Conte. This code was based on the TLSF documentation.

This implementation was written to the specification of the document, therefore no GPL restrictions apply.

Features

  • O(1) cost for malloc, free, realloc, aligned_alloc
  • Low overhead per allocation (one word)
  • Low overhead for the TLSF metadata (~4kB)
  • Low fragmentation
  • Very small - only ~500 lines of code
  • Compiles to only a few kB of code and data
  • Uses a linear memory area, which is resized on demand
  • Not thread safe. API calls must be protected by a mutex in a multi-threaded environment.
  • Works in environments with only minimal libc, uses only stddef.h, stdbool.h, stdint.h and string.h.

Reference

M. Masmano, I. Ripoll, A. Crespo, and J. Real. TLSF: a new dynamic memory allocator for real-time systems. In Proc. ECRTS (2004), IEEE Computer Society, pp. 79-86.

Licensing

TLSF-BSD is freely redistributable under the 3-clause BSD License. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

About

Two Level Segregated Fit (TLSF) memory allocator implementation, BSD License

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8