{"id":20196058,"url":"https://github.com/thehxdev/balloc","last_synced_at":"2025-04-10T10:23:12.300Z","repository":{"id":238974098,"uuid":"798144398","full_name":"thehxdev/balloc","owner":"thehxdev","description":"Fixed Buffer Memory Allocator in C","archived":false,"fork":false,"pushed_at":"2024-05-13T07:04:58.000Z","size":19,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-13T20:25:11.793Z","etag":null,"topics":["allocator","c","memory-allocator"],"latest_commit_sha":null,"homepage":"","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/thehxdev.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":"2024-05-09T07:19:11.000Z","updated_at":"2024-07-04T02:07:25.816Z","dependencies_parsed_at":"2024-05-12T20:25:09.748Z","dependency_job_id":null,"html_url":"https://github.com/thehxdev/balloc","commit_stats":null,"previous_names":["thehxdev/balloc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehxdev%2Fballoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehxdev%2Fballoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehxdev%2Fballoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehxdev%2Fballoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thehxdev","download_url":"https://codeload.github.com/thehxdev/balloc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199079,"owners_count":21063641,"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","c","memory-allocator"],"created_at":"2024-11-14T04:21:30.100Z","updated_at":"2025-04-10T10:23:12.274Z","avatar_url":"https://github.com/thehxdev.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fixed Buffer Memory Allocator\n\nMy implementation of Fixed Buffer Memory Allocator in C.\n\n\n## How it works?\n\nThis memory allocator designed to minimize the calls to `malloc` and `free` (in general, system calls) because they\ntend to be slow. The allocator allocates a fixed size buffer (4096 Bytes by default) and uses that to store data.\n\nTake a look at `test/test.c` file to see how to use this memory allocator.\n\n\n## Public API\n\nThis section covers balloc's public API\n\n### Constants\n\nThere are 3 constants in `src/balloc.h` file that you can modify.\n\n#### `BALLOC_DEBUG`\nSet this constant to `1` to enable logging.\n\n#### `BALLOC_PTR_MD`\nSet this constant to `1` to store pointers metadata. This will waste a size of `size_t` type for each pointer on the buffer.\nBut, to do some memory operations safely (since all data lives in a buffer) it's important to know each pointer's size.\n\n#### `DEFAULT_BUFF_SIZE`\nDefault buffer size. (4096 Bytes)\n\n---\n\n### Functions\n\n#### `balloc_new`\nCreate and construct a new fixed buffer allocator with type `BuffAlloc`.\n\n#### Other funcitons\nTake a look at `src/balloc.h` in `Public API` section for all functions that are available to you.\nYou can also read `test/test.c` file to see how to use public API and some functions that balloc provides.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthehxdev%2Fballoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthehxdev%2Fballoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthehxdev%2Fballoc/lists"}