Git Product home page Git Product logo

compalloc's Introduction

compalloc

All allocators manage a piece of memory given to them, they are not global and are not thread-safe, unless it's the user desire to do so.

Important aspects:

  • Composable: it should be entirely possible to allocate a chunk from a free list allocator, and set up another allocator in that region, be it a stack/pool/free-list/etc allocator;
  • Local: allocators should not have global context unless the user wants to do so;
  • Modular: each allocation algorithm should exist by themselves, completely separate;
  • Simple: no allocation algorithm shall possess enough complexity to bite us in the foot;
  • Tested: all allocators shall be throughly tested, nobody wants do debug memory bugs.

Why?

Most allocators are global in nature, we can't segregate memory in a way that it's possible for a section of a program to run out of memory without impacting the whole program. This feature of locality is specially useful for writing interpreters, the main program may run the interpreter in a segmented part of memory, making it impossible for the interpreter to consume memory of the entire application.

Most allocators are not composable, being global, they do not work well together. Here, we should be able to have a pool of memory chunks, where each memory chunk is managed by a stack allocator, if that is our desire to do so.

Most allocators support a single algorithm, which often is very complex. This library intends do shuffle the complexity to the end user, making the user decide the algorithms, segments and how these are composed together. It assumes there are no single best solution to all programs, as such, a single allocator will not serve all programmer needs.

compalloc's People

Contributors

padeir0 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.