{"id":20446281,"url":"https://github.com/rust-embedded/embedded-alloc","last_synced_at":"2025-12-12T16:35:48.875Z","repository":{"id":42447012,"uuid":"74217191","full_name":"rust-embedded/embedded-alloc","owner":"rust-embedded","description":"A heap allocator for embedded systems","archived":false,"fork":false,"pushed_at":"2025-02-03T11:42:58.000Z","size":121,"stargazers_count":380,"open_issues_count":4,"forks_count":57,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-12T15:55:29.475Z","etag":null,"topics":["allocator","arm","cortex-m","microcontroller","no-std","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-embedded.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-19T15:34:18.000Z","updated_at":"2025-04-18T10:37:54.000Z","dependencies_parsed_at":"2023-11-12T13:27:22.166Z","dependency_job_id":"739ed068-a3d0-4d2d-ad7d-16aaab089e4c","html_url":"https://github.com/rust-embedded/embedded-alloc","commit_stats":{"total_commits":107,"total_committers":28,"mean_commits":"3.8214285714285716","dds":0.794392523364486,"last_synced_commit":"dd4391d23c1fd97c974f02b5f3caa339e66b7e48"},"previous_names":["rust-embedded/alloc-cortex-m"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fembedded-alloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fembedded-alloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fembedded-alloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fembedded-alloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-embedded","download_url":"https://codeload.github.com/rust-embedded/embedded-alloc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149919,"owners_count":22022851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["allocator","arm","cortex-m","microcontroller","no-std","rust"],"created_at":"2024-11-15T10:18:50.042Z","updated_at":"2025-12-12T16:35:48.817Z","avatar_url":"https://github.com/rust-embedded.png","language":"Rust","readme":"[![crates.io](https://img.shields.io/crates/d/embedded-alloc.svg)](https://crates.io/crates/embedded-alloc)\n[![crates.io](https://img.shields.io/crates/v/embedded-alloc.svg)](https://crates.io/crates/embedded-alloc)\n![Minimum Supported Rust Version](https://img.shields.io/badge/rustc-1.68+-blue.svg) -\n [Documentation](https://docs.rs/embedded-alloc) - [Change log](https://github.com/rust-embedded/embedded-alloc/blob/master/CHANGELOG.md)\n\n# `embedded-alloc`\n\n\u003e A heap allocator for embedded systems.\n\nNote that using this as your global allocator requires Rust 1.68 or later.\n(With earlier versions, you need the unstable feature `#![feature(default_alloc_error_handler)]`)\n\nThis project is developed and maintained by the [libs team][team].\n\n## Example\n\nStarting with Rust 1.68, this crate can be used as a global allocator on stable Rust:\n\n```rust\n#![no_std]\n#![no_main]\n\nextern crate alloc;\n\nuse cortex_m_rt::entry;\nuse embedded_alloc::LlffHeap as Heap;\n\n#[global_allocator]\nstatic HEAP: Heap = Heap::empty();\n\n#[entry]\nfn main() -\u003e ! {\n    // Initialize the allocator BEFORE you use it\n    {\n        use core::mem::MaybeUninit;\n        const HEAP_SIZE: usize = 1024;\n        static mut HEAP_MEM: [MaybeUninit\u003cu8\u003e; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];\n        unsafe { HEAP.init(\u0026raw mut HEAP_MEM as usize, HEAP_SIZE) }\n    }\n\n    // now the allocator is ready types like Box, Vec can be used.\n\n    loop { /* .. */ }\n}\n```\n\nFor a full usage example, see [`examples/global_alloc.rs`](https://github.com/rust-embedded/embedded-alloc/blob/master/examples/global_alloc.rs).\n\nFor this to work, an implementation of [`critical-section`](https://github.com/rust-embedded/critical-section) must be provided.\n\nFor simple use cases with Cortex-M CPUs you may enable the `critical-section-single-core` feature in the [cortex-m](https://github.com/rust-embedded/cortex-m) crate.\nPlease refer to the documentation of [`critical-section`](https://docs.rs/critical-section) for further guidance.\n\n## Features\n\nThere are two heaps available to use:\n\n* `llff`: Provides `LlffHeap`, a Linked List First Fit heap.\n* `tlsf`: Provides `TlsfHeap`, a Two-Level Segregated Fit heap.\n\nThe best heap to use will depend on your application, see [#78](https://github.com/rust-embedded/embedded-alloc/pull/78) for more discussion.\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n  \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\n## Code of Conduct\n\nContribution to this crate is organized under the terms of the [Rust Code of\nConduct][CoC], the maintainer of this crate, the [libs team][team], promises\nto intervene to uphold that code of conduct.\n\n[CoC]: CODE_OF_CONDUCT.md\n[team]: https://github.com/rust-embedded/wg#the-libs-team\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-embedded%2Fembedded-alloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-embedded%2Fembedded-alloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-embedded%2Fembedded-alloc/lists"}