{"id":19243807,"url":"https://github.com/amrdb/babymalloc","last_synced_at":"2025-07-17T12:36:34.599Z","repository":{"id":253411414,"uuid":"843424248","full_name":"amrdb/babymalloc","owner":"amrdb","description":"A dynamic memory allocator library in C","archived":false,"fork":false,"pushed_at":"2024-11-18T10:49:40.000Z","size":39,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-21T09:52:12.941Z","etag":null,"topics":[],"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/amrdb.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,"zenodo":null}},"created_at":"2024-08-16T13:37:33.000Z","updated_at":"2025-04-06T03:13:08.000Z","dependencies_parsed_at":"2024-10-26T22:45:36.294Z","dependency_job_id":"be6fc552-520d-4a96-aeb0-c3e6150beae1","html_url":"https://github.com/amrdb/babymalloc","commit_stats":null,"previous_names":["amr2812/babymalloc","amrdb/babymalloc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amrdb/babymalloc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrdb%2Fbabymalloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrdb%2Fbabymalloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrdb%2Fbabymalloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrdb%2Fbabymalloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amrdb","download_url":"https://codeload.github.com/amrdb/babymalloc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrdb%2Fbabymalloc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262679369,"owners_count":23347528,"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-09T17:20:07.141Z","updated_at":"2025-06-29T22:35:07.065Z","avatar_url":"https://github.com/amrdb.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babymalloc\nA dynamic memory allocator in C, inspired by the [CS:APP malloc lab](http://csapp.cs.cmu.edu/3e/labs.html) from the CMU course [Intro to Computer Systems](https://www.cs.cmu.edu/afs/cs/academic/class/15213-f15/www/schedule.html).\n\n### Description\nThis is a dynamic memory allocator that utilizes simple techniques:\n- First-fit placement policy:\n  - The allocator searches for the first free block that is large enough to fit the requested size.\n- Boundary tags:\n  - Each block contains a header and footer that store the size of the block and whether the block is allocated or free.\n  - This allows the allocator to traverse the heap in both directions.\n- Implicit free list:\n  - The allocator uses a simple implicit free list to keep track of free blocks.\n  - The allocator traverses the free list using the size of the blocks.\n- Immediate coalescing:\n  - When a block is freed, the allocator checks if the adjacent blocks (in both sides) are free and coalesces them.\n- Splitting:\n  - When a free block is selected for an allocation, the allocator checks if the block is large enough to be split into two blocks.\n- sbrk:\n  - The allocator uses the sbrk system call to request more memory from the kernel when the heap is full.\n- Alignment:\n  - The allocator aligns the blocks to the word size of the CPU.\n- Platform Compatibility:\n  - The allocator works on 64-bit, 32-bit and smaller CPUs on UNIX-like systems.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrdb%2Fbabymalloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famrdb%2Fbabymalloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrdb%2Fbabymalloc/lists"}