Code Monkey home page Code Monkey logo

acid_alloc's Introduction

acid_alloc

CI crates-io api-docs

Bare-metal allocators.

This crate provides allocators that are suitable for use on bare metal or with OS allocation facilities like mmap(2)/brk(2).

The following allocator types are available:

  • Buddy, a binary-buddy allocator. O(log2levels) worst-case allocation and deallocation. Supports splitting and coalescing blocks by powers of 2. Good choice for periodic medium-to-large allocations.
  • Bump, a bump allocator. O(1) allocation. Extremely fast to allocate and flexible in terms of allocation layout, but unable to deallocate individual items. Good choice for allocations that will never be deallocated or that will be deallocated en masse.
  • Slab, a slab allocator. O(1) allocation and deallocation. All allocated blocks are the same size, making this allocator a good choice when allocating many similarly-sized objects.

Features

All allocators provided by this crate are available in a #![no_std], #![cfg(no_global_oom_handling)] environment. Additional functionality is available when enabling feature flags:

Flag Default? Requires nightly? Description
sptr Yes No Uses the sptr polyfill for Strict Provenance.
unstable No Yes Exposes constructors for allocators backed by implementors of the unstable Allocator trait, and enables the internal use of nightly-only Rust features. Obviates sptr.
alloc No No Exposes constructors for allocators backed by the global allocator.

Acknowledgments

This crate includes stable-compatible polyfills for a number of unstable standard-library APIs whose implementations are reproduced verbatim here. These features are listed below along with their authors and/or maintainers:

This crate also depends on sptr (also authored by Gankra) to reproduce strict provenance for normal pointers on stable Rust.

If I've misattributed any of this work, or a contributor to these features is missing, please open an issue!

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

acid_alloc's People

Contributors

dataphract avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

luctius clownsw

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.