{"id":13626627,"url":"https://github.com/suirad/adma","last_synced_at":"2025-04-12T03:24:40.146Z","repository":{"id":54825163,"uuid":"272875458","full_name":"suirad/adma","owner":"suirad","description":"A general purpose, multithreaded capable slab allocator for Zig","archived":false,"fork":false,"pushed_at":"2021-01-27T06:31:44.000Z","size":21,"stargazers_count":59,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T23:01:43.744Z","etag":null,"topics":["allocator","general-purpose","slab-allocator","zig","zig-lang","zig-library"],"latest_commit_sha":null,"homepage":null,"language":"Zig","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/suirad.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}},"created_at":"2020-06-17T04:11:37.000Z","updated_at":"2025-03-24T06:55:02.000Z","dependencies_parsed_at":"2022-08-14T04:00:44.220Z","dependency_job_id":null,"html_url":"https://github.com/suirad/adma","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suirad%2Fadma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suirad%2Fadma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suirad%2Fadma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suirad%2Fadma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suirad","download_url":"https://codeload.github.com/suirad/adma/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248511090,"owners_count":21116352,"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","general-purpose","slab-allocator","zig","zig-lang","zig-library"],"created_at":"2024-08-01T21:02:25.212Z","updated_at":"2025-04-12T03:24:40.122Z","avatar_url":"https://github.com/suirad.png","language":"Zig","readme":"# A.D.M.A - Acronyms Dont Mean Anything\r\n\r\nAdma is a general purpose allocator for zig with the following features:\r\n\r\n- [x] [Slab Allocation strategy](https://en.wikipedia.org/wiki/Slab_allocation)\r\n- [x] Optimized for rapid small memory allocation/releasing\r\n- [x] Reuse of OS provided allocations\r\n- [x] Non-Blocking allocation \u0026 free within a thread\r\n- [x] Multithreaded Capable\r\n- [x] Automatic feature reduction for single threaded use\r\n- [x] Safe freeing of memory sent to a different thread\r\n\r\n## Getting started\r\n\r\nIn Zig:\r\n\r\n```zig\r\nconst adma = @Import(\"adma\");\r\n\r\npub fn example() !void {\r\n    // .initWith using a c allocator\r\n    //const adma_ref = try adma.AdmaAllocator.initWith(std.heap.c_allocator, 0);\r\n\r\n    // .init defaults to using std.heap.page_allocator underneath for ease of use\r\n    const adma_ref = adma.AdmaAllocator.init();\r\n    defer adma_ref.deinit();\r\n\r\n    const allocator = \u0026adma_ref.allocator;\r\n\r\n    var buf = try allocator.alloc(u8, 100);\r\n    defer allocator.free(buf);\r\n}\r\n\r\n```\r\n\r\n## Usage Notes\r\n\r\n- If using adma in a multithreaded context, ensure you `AdmaAllocator.init/deinit`\r\n in every thread; not pass the allocator pointer to the additional thread\r\n- If using for zig prior to the big allocation interface change, see the branch\r\ncalled `pre-allocator-revamp`\r\n\r\n","funding_links":[],"categories":["Zig","Libraries","Language Essentials"],"sub_categories":["Memory Allocator and Management"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuirad%2Fadma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuirad%2Fadma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuirad%2Fadma/lists"}