{"id":21497326,"url":"https://github.com/jazzfool/buddy","last_synced_at":"2025-03-17T12:25:28.279Z","repository":{"id":137122151,"uuid":"265726061","full_name":"jazzfool/buddy","owner":"jazzfool","description":"C Buddy Allocator","archived":false,"fork":false,"pushed_at":"2020-05-21T01:49:51.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T22:14:03.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/jazzfool.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":"2020-05-21T01:34:16.000Z","updated_at":"2020-06-15T06:29:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"fea9a038-9d18-4d36-9ec1-834adf905a4e","html_url":"https://github.com/jazzfool/buddy","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/jazzfool%2Fbuddy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzfool%2Fbuddy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzfool%2Fbuddy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzfool%2Fbuddy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jazzfool","download_url":"https://codeload.github.com/jazzfool/buddy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244031733,"owners_count":20386654,"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":[],"created_at":"2024-11-23T16:23:16.724Z","updated_at":"2025-03-17T12:25:28.255Z","avatar_url":"https://github.com/jazzfool.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple buddy allocator.\n\nA buddy allocator allocates based on halved partitions.\nThe allocator will halve the partitions as much as possible,\nthen give the final halved partition to the allocatee.\n\nMoreover, allocations within free'd partitions can allow for\ncoalescing of partitions (i.e. merging partitions).\n\nThis leads to minimal external fragmentation, but results in\ninternal fragmentation.\n\nIn order to use this implementation; in a single translation unit,\ndefine BUDDY_ALLOC_IMPLEMENTATION then include \"buddy.h\".\nIn all other files, include \"buddy.h\" normally.\n\nNote: This doesn't actually allocate any memory. The buffer simply\nhas a specified size and allocations consist of offset + size.\nThis is to be integrated with actual memory (e.g. a GPU buffer).\n\nExample Usage;\n```\nBuddyBuffer* buf = buddy_buf_new(1024);\n\nBuddyAllocation alloc;\nif (!buddy_buf_alloc(buf, 30, \u0026alloc)) {\n  printf(\"allocation failed!\");\n  return;\n}\n\nprintf(\"offset: %zu, size: %zu\", alloc.offset, alloc.size);\n\nbuddy_buf_free(alloc); // this is optional\nbuddy_buf_destroy(buf);\n```\n\nThis is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazzfool%2Fbuddy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjazzfool%2Fbuddy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazzfool%2Fbuddy/lists"}