{"id":30762661,"url":"https://github.com/alberto-lazari/grain","last_synced_at":"2025-09-04T15:08:34.152Z","repository":{"id":310224645,"uuid":"1039135981","full_name":"alberto-lazari/grain","owner":"alberto-lazari","description":"C++ memory manager for grain-sized objects","archived":false,"fork":false,"pushed_at":"2025-08-16T16:52:09.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-16T17:19:19.291Z","etag":null,"topics":["cmake","cpp-library","cpp20","memory-allocator","memory-management","modern-cpp","small-object-optimization"],"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/alberto-lazari.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-16T14:58:58.000Z","updated_at":"2025-08-16T16:52:13.000Z","dependencies_parsed_at":"2025-08-16T17:29:26.168Z","dependency_job_id":null,"html_url":"https://github.com/alberto-lazari/grain","commit_stats":null,"previous_names":["alberto-lazari/grain"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/alberto-lazari/grain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alberto-lazari%2Fgrain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alberto-lazari%2Fgrain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alberto-lazari%2Fgrain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alberto-lazari%2Fgrain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alberto-lazari","download_url":"https://codeload.github.com/alberto-lazari/grain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alberto-lazari%2Fgrain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273626534,"owners_count":25139495,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cmake","cpp-library","cpp20","memory-allocator","memory-management","modern-cpp","small-object-optimization"],"created_at":"2025-09-04T15:08:32.319Z","updated_at":"2025-09-04T15:08:34.139Z","avatar_url":"https://github.com/alberto-lazari.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌾 Grain\n\nA C++ memory manager for grain-sized objects.\n\nDeveloped as final project of the *Advanced C++* course for the Master in Computer Game Development.\n\n\n## Overview\n\nThe project is based on Andrei Alexandrescu's `SmallObjectAllocator`,\ndescribed in his *Modern C++ Design* book.\n\nThe generic, long names he used in his implementation looked pretty ugly to me,\nso I decided to give them a farming twist,\nmapping each to a concrete item related to grains of wheat:\n\n| Name      | Analogy                                  | Original Name          |\n| --------- | ---------------------------------------- | ---------------------- |\n| `Granary` | Main storage of different kinds of grain | `SmallObjectAllocator` |\n| `Sack`    | Set of grains of the same kind (size)    | `FixedAllocator`       |\n| `Handful` | A small handful of grains                | `Chunk`                |\n| `Grain`   | Smallest distributable unit              | Memory block           |\n\n\u003e [!NOTE]\n\u003e I'm well aware that this entire *grain metaphor*-thing makes the code pretty unreadable,\n\u003e but readability and usability in general are really not the point here.\n\u003e\n\u003e This is a simple University project, aiming to replicate an existing implementation,\n\u003e and is obviously not meant to appear in real-world codebases.\n\u003e I just wanted to have some fun while working on it.\n\n\n## Build and Test\n\nThe project comes with a cross-platform CMake configuration.\nYou can build the project from the command line or open it as a folder in Visual Studio,\nleaving it to the IDE to automatically load the targets.\n\nTests are split into separate executables that you can run from the CMake targets. \\\nOn POSIX you can run them all with a simple `make test`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falberto-lazari%2Fgrain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falberto-lazari%2Fgrain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falberto-lazari%2Fgrain/lists"}