{"id":18823590,"url":"https://github.com/yvt/xalloc-rs","last_synced_at":"2025-04-14T01:31:06.425Z","repository":{"id":26365801,"uuid":"108564694","full_name":"yvt/xalloc-rs","owner":"yvt","description":"Dynamic suballocators for external memory (e.g., Vulkan device memory). Umaintained - consider migrating to https://crates.io/crates/offset-allocator","archived":false,"fork":false,"pushed_at":"2022-07-22T02:26:40.000Z","size":58,"stargazers_count":15,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T21:40:22.234Z","etag":null,"topics":["directx-12","memory-allocator","rust","tlsf","vulkan"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/xalloc","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/yvt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-27T15:45:33.000Z","updated_at":"2024-05-03T01:08:06.000Z","dependencies_parsed_at":"2022-07-27T08:18:37.216Z","dependency_job_id":null,"html_url":"https://github.com/yvt/xalloc-rs","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvt%2Fxalloc-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvt%2Fxalloc-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvt%2Fxalloc-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvt%2Fxalloc-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yvt","download_url":"https://codeload.github.com/yvt/xalloc-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761050,"owners_count":20991531,"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":["directx-12","memory-allocator","rust","tlsf","vulkan"],"created_at":"2024-11-08T00:54:06.540Z","updated_at":"2025-04-14T01:31:06.375Z","avatar_url":"https://github.com/yvt.png","language":"Rust","readme":"# xalloc\n\n[\u003cimg src=\"https://docs.rs/xalloc/badge.svg\" alt=\"docs.rs\"\u003e](https://docs.rs/xalloc/)\n\nDynamic suballocators for external memory (e.g., Vulkan device memory).\n\n## Provided Algorithms\n\n### Generic\n\n|               Name              | Time Complexity |  Space Complexity |\n| ------------------------------- | --------------- | ----------------- |\n| TLSF (Two-Level Segregated Fit) | `O(1)`          | `O(N + log size)` |\n| Free space bitmap               | `O(size)`       | `O(size)`         |\n\n### Specialized\n\n|               Name              | Time Complexity |  Space Complexity |\n| ------------------------------- | --------------- | ----------------- |\n| Ring buffer                     | `O(1)`          | `O(N)`            |\n\n(`size`: heap size measured by the number of allocation units, `N`: number of allocations)\n\n## Examples\n\n```rust\nuse xalloc::{SysTlsf, SysTlsfRegion};\nlet mut tlsf = xalloc::SysTlsf::new(8u32);\n\n// Allocate regions\nlet alloc1: (SysTlsfRegion, u32) = tlsf.alloc(4).unwrap();\nlet alloc2: (SysTlsfRegion, u32) = tlsf.alloc(4).unwrap();\nlet (region1, offset1) = alloc1;\nlet (region2, offset2) = alloc2;\nprintln!(\"allocated #1: {:?}\", (\u0026region1, offset1));\nprintln!(\"allocated #2: {:?}\", (\u0026region2, offset2));\n\n// Deallocate a region\ntlsf.dealloc(region1).unwrap();\n\n// Now we can allocate again\ntlsf.alloc(2).unwrap();\ntlsf.alloc(2).unwrap();\n```\n\n## Feature Flags\n\n- `nightly` — Enables optimizations which currently require a Nightly Rust\n  compiler. This flag is now unused due to the [stabilization] of `NonNull`\n  in Rust 1.25.\n\n[stabilization]: https://blog.rust-lang.org/2018/03/29/Rust-1.25.html\n\n\nLicense: MIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyvt%2Fxalloc-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyvt%2Fxalloc-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyvt%2Fxalloc-rs/lists"}