{"id":23080207,"url":"https://github.com/olemorud/arena-allocator","last_synced_at":"2025-04-30T12:38:01.284Z","repository":{"id":172173342,"uuid":"648711091","full_name":"olemorud/arena-allocator","owner":"olemorud","description":"Arena Allocator implementation in C","archived":false,"fork":false,"pushed_at":"2024-01-16T01:34:41.000Z","size":30,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-16T13:05:31.590Z","etag":null,"topics":["arena-allocator","c","library"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olemorud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-06-02T16:02:14.000Z","updated_at":"2024-12-08T14:28:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"40b4b7b0-e7ca-464a-b273-0e748c7d05f4","html_url":"https://github.com/olemorud/arena-allocator","commit_stats":null,"previous_names":["olemorud/arena-allocator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olemorud%2Farena-allocator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olemorud%2Farena-allocator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olemorud%2Farena-allocator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olemorud%2Farena-allocator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olemorud","download_url":"https://codeload.github.com/olemorud/arena-allocator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237897383,"owners_count":19383726,"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":["arena-allocator","c","library"],"created_at":"2024-12-16T13:05:35.996Z","updated_at":"2025-02-09T02:34:02.861Z","avatar_url":"https://github.com/olemorud.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Arena Allocator\n\nArena allocators are region based allocators that tie many allocations to a\nsingle region of memory. Benefits are massivly simplified allocation and\ndeallocation for complex structures, increased performance due to improved\ncache locality, and reduced memory fragmentation as long as individual items\ndon't need to be deallocated. For programs that need to micro-manage individual\nallocations this is not an ideal solution.\n\nDeallocating a region of memory with arenas is extremely fast, because the\narena length is just set to 0. Allocating memory is also extremely fast.  This\nimplementation also grows the arena on demand using mmap and mprotect.\nExtending the library with a new type of allocation strategy should be easy.\n\n# Reference\n\n\n## `arena_t arena_new()`\n\nAllocate a new arena.\n\nIf `arena_new()` fails, the struct member `data` is set to NULL.  This can be\nchecked with `arena_new_failed()`\n\n\n## `bool arena_new_failed(arena_t *a)`\n\nReturns true if creating a new arena failed\n\n\n## `int arena_delete(arena_t *a)`\n\nDelete underlying buffer of arena.  Should only be used with arenas from\n`arena_new()`.\n\nReturns 0 on success, -1 on failure\n\n\n## `arena_t arena_attach(void *ptr, size_t size)`\n\nAttach an arena to an existing memory region.  The arena will not expand if\ncapacity is exceeded.\n\n\n## `void *arena_detatch(arena_t arena)`\n\nDetach an arena from an existing memory region. Returns the underlying data.\n\n\n## `void arena_reset(arena_t *a)`\n\nResets an arena.\n\n\n## `void *arena_alloc(arena_t *a, size_t len)`\n\nAllocate memory with an arena. Returns NULL and sets errno on failure.\n\n\n## `void *arena_calloc(arena_t *a, size_t nmemb, size_t size)`\n\nAllocate and zero memory with an arena.  Returns NULL and sets errno on\nfailure.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folemorud%2Farena-allocator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folemorud%2Farena-allocator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folemorud%2Farena-allocator/lists"}