{"id":13648674,"url":"https://github.com/rcore-os/buddy_system_allocator","last_synced_at":"2025-04-09T05:10:54.788Z","repository":{"id":40650451,"uuid":"176138943","full_name":"rcore-os/buddy_system_allocator","owner":"rcore-os","description":"A buddy system allocator in pure Rust.","archived":false,"fork":false,"pushed_at":"2024-09-21T16:45:13.000Z","size":83,"stargazers_count":104,"open_issues_count":2,"forks_count":25,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-02T04:04:01.645Z","etag":null,"topics":["allocator","bare-metal-programming","buddy-system","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rcore-os.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-17T17:54:28.000Z","updated_at":"2025-04-01T09:14:43.000Z","dependencies_parsed_at":"2024-01-14T10:59:34.511Z","dependency_job_id":"082901b9-58a5-4f61-a359-ff3598d38b1d","html_url":"https://github.com/rcore-os/buddy_system_allocator","commit_stats":{"total_commits":60,"total_committers":12,"mean_commits":5.0,"dds":0.5666666666666667,"last_synced_commit":"e169dbe035f23f22bbc849e6d4f794821f9cb696"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2Fbuddy_system_allocator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2Fbuddy_system_allocator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2Fbuddy_system_allocator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcore-os%2Fbuddy_system_allocator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcore-os","download_url":"https://codeload.github.com/rcore-os/buddy_system_allocator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980837,"owners_count":21027808,"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","bare-metal-programming","buddy-system","rust"],"created_at":"2024-08-02T01:04:26.805Z","updated_at":"2025-04-09T05:10:54.748Z","avatar_url":"https://github.com/rcore-os.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# buddy_system_allocator\n\n[![Crates.io version][crate-img]][crate]\n[![docs.rs][docs-img]][docs]\n\nAn (almost) drop-in replacement for [phil-opp/linked-list-allocator](https://github.com/phil-opp/linked-list-allocator). But it uses buddy system instead.\n\n## Usage\n\nTo use buddy_system_allocator for global allocator:\n\n```rust\nuse buddy_system_allocator::LockedHeap;\n\n#[global_allocator]\nstatic HEAP_ALLOCATOR: LockedHeap = LockedHeap::\u003c33\u003e::empty();\n```\n\nTo init the allocator:\n\n```rust\nunsafe {\n    HEAP_ALLOCATOR.lock().init(heap_start, heap_size);\n    // or\n    HEAP_ALLOCATOR.lock().add_to_heap(heap_start, heap_end);\n}\n```\n\nYou can also use `FrameAllocator` and `LockedHeapWithRescue`, see their documentation for usage.\n\n## Features\n\n- **`alloc`** (default): Provide `FrameAllocator` and `LockedFrameAllocator`, which depend on a\n  global allocator.\n- **`use_spin`** (default): Provide a `LockedHeap` type that implements the [`GlobalAlloc`] trait by\n  using a spinlock.\n\n[`GlobalAlloc`]: https://doc.rust-lang.org/nightly/core/alloc/trait.GlobalAlloc.html\n\n## License\n\nSome code comes from phil-opp's linked-list-allocator.\n\nLicensed under MIT License. Thanks phill-opp's linked-list-allocator for inspirations and interface.\n\n[crate-img]: https://img.shields.io/crates/v/buddy_system_allocator.svg\n[crate]: https://crates.io/crates/buddy_system_allocator\n[docs-img]: https://docs.rs/buddy_system_allocator/badge.svg\n[docs]: https://docs.rs/buddy_system_allocator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcore-os%2Fbuddy_system_allocator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcore-os%2Fbuddy_system_allocator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcore-os%2Fbuddy_system_allocator/lists"}