GithubHelp home page GithubHelp logo

timstableford / dynamicbuffer Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 13 KB

A utility to allow dynamically sized and fragmented buffers within a fixed size buffer

License: MIT License

CMake 5.19% C++ 94.81%
buffer-management buffer memory-management arduino

dynamicbuffer's Introduction

Fixed Fragmented Buffer Allocation Utility

Allocation system to allow fragmented memory buffers in a fixed size suepr-buffer.

Description

This class is mostly useful on memory constrained devices such as the Arduino. On those devices you may want to create and delete arrays of objects reasonably often. Unless very careful that causes memory fragmentation that leads to an eventual crash.

This buffering system allocates a fixed array when its created and splits that array into slots. Additionally even if allocated slots are non-contiguous they can still be accessed as if they are.

For example in a 3 slot buffer [1, 2, 3] if slot 2 is taken and the user requests 2 slots of storage then they're assigned slots 1 and 3. They can then get a class from the DynamicBuffer that provides an array accessor method that would allow them to be access as [1, 2].

For examples consult Test.cpp which contains a number of use cases. The header file is also documented.

License

This project uses the MIT license.

dynamicbuffer's People

Contributors

timstableford avatar

Stargazers

 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.