Git Product home page Git Product logo

tlsf-bsd's Introduction

TLSF-BSD

Two Level Segregated Fit memory allocator implementation with O(1) time complexity, distributed under the BSD License.

Features

  • O(1) cost for malloc, free, realloc, memalign
  • Extremely low overhead per allocation (4 bytes)
  • Low overhead per TLSF management of pools (~3kB)
  • Low fragmentation
  • Compiles to only a few kB of code and data
  • Support for adding and removing memory pool regions on the fly

Caveats

  • Currently, assumes architecture can make 4-byte aligned accesses
  • Not designed to be thread safe; the user must provide this

Notes

This code was based on the TLSF 1.4 spec and documentation found at: http://www.gii.upv.es/tlsf/main/docs

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.

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

It also leverages the TLSF 2.0 improvement to shrink the per-block overhead from 8 to 4 bytes.

Known Issues

  • Due to the internal block structure size and the implementation details of tlsf_memalign, there is worst-case behavior when requesting small (<16 byte) blocks aligned to 8-byte boundaries. Overuse of memalign will generally increase fragmentation, but this particular case will leave lots of unusable "holes" in the pool. The solution would be to internally align all blocks to 8 bytes, but this will require significantl changes to the implementation.

Licensing

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

tlsf-bsd's People

Contributors

dungru avatar jserv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.