{"id":20179699,"url":"https://github.com/portasynthinca3/randalloc","last_synced_at":"2025-04-10T04:45:59.641Z","repository":{"id":261688028,"uuid":"881631571","full_name":"portasynthinca3/randalloc","owner":"portasynthinca3","description":"Blazing fast and memory safe malloc implementation using rand.","archived":false,"fork":false,"pushed_at":"2025-01-24T14:07:06.000Z","size":7,"stargazers_count":30,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T06:03:27.459Z","etag":null,"topics":["blazing-fast","joke-project","malloc","memory-safe"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/portasynthinca3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-11-01T00:03:54.000Z","updated_at":"2025-03-11T11:58:14.000Z","dependencies_parsed_at":"2024-11-07T22:26:13.558Z","dependency_job_id":"a8c38f2f-ec92-4a7a-a761-256833945381","html_url":"https://github.com/portasynthinca3/randalloc","commit_stats":null,"previous_names":["portasynthinca3/randalloc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/portasynthinca3%2Frandalloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/portasynthinca3%2Frandalloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/portasynthinca3%2Frandalloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/portasynthinca3%2Frandalloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/portasynthinca3","download_url":"https://codeload.github.com/portasynthinca3/randalloc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161237,"owners_count":21057552,"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":["blazing-fast","joke-project","malloc","memory-safe"],"created_at":"2024-11-14T02:27:50.859Z","updated_at":"2025-04-10T04:45:59.633Z","avatar_url":"https://github.com/portasynthinca3.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# randalloc\nrandalloc is a 🚀 **BLAZING FAST**, 🚀 **MEMORY SAFE** and 🚀 **THREAD SAFE**\nmemory allocator. It works like this:\n```c\nvoid* malloc(size_t s) { return (void*)rand(); }\n```\n\nActually, _a bit more_ is required to actually make `rand` work like that. Go\nread [`randalloc.c`](https://github.com/portasynthinca3/randalloc/blob/master/randalloc.c),\nit's just 36 lines long.\n\n## Run it!\n```\ngit clone https://github.com/portasynthinca3/randalloc.git\ncd randalloc\ncat main.c # just kinda look at what the code does\nsh randalloc.sh\n```\n\n## Use it!\n  - Yank [`randalloc.c`](https://github.com/portasynthinca3/randalloc/blob/master/randalloc.c)\n    from this repo and paste it into your project.\n  - Call `_init_alloc` as close to entry as possible.\n  - Compile your project with `-Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=realloc`.\n  - Enjoy  🚀 **BLAZING FASTNESS**, 🚀 **MEMORY SAFETY** and 🚀 **THREAD\n    SAFETY** in your very own project that you chose to write in a legacy\n    language!\n\n## Performance\nThe allocator runs in O(1) time. And that constant is quite small, not gonna lie.\n\nHave I measured it? No. But it's fast; like look at it!\n\n## Memory safety\nAssuming you are fortunate enough that your allocations don't overlap, your code\nwill be memory safe!\n\n## Thread safety\nThis allocator does not need to take any extra precautions to ensure thread\nsafety. That not only means it's 🚀 **BLAZING SAFE**, it's also 🚀 **THREAD\nFAST**!\n\nWait, no, I think I might have mixed up something.\n\n## Why?\n  - I just discovered the `--wrap` linker flag and my mind was absolutely\n    **blown**.\n  - I saw the original implementation in someone's Discord status.\n  - Yes, I am a little child.\n\n## Licensing\nThis project is hereby licensed under the [WTFPL](http://www.wtfpl.net/txt/copying/).\n\n## Contribution Policy\nDue to various compliance requirements, you are now required to submit a DNA\ntest in your first pull request to this repository. If it is found out that you\nare more than 50% Russian by blood, your pull request will be rejected.\nAdditionally, if it is found out that you are more than 10% Russian by blood,\nyou must provide one of the following or your pull request will be rejected:\n  - A photo of a valid ID or equivalent document proving that you are not\n    citizen of the Russian Federation;\n  - A photo of a valid residence permit or equivalent document issued by a state\n    other than the Russian Federation before Sept. 21st, 2022 (the start of\n    mobilization in the Russian Federation);\n  - A video of you burning down your Russian ID and passport and subsequently\n    singlehandedly overthrowing your dictator.\n\nIn addition to all the requirements outlined above, you must prove that you have\nnever worked for a Russian-based company sanctioned by the glorious U.S. of A.\n\nThese requirements are retroactive; shall we ever find out that your status\n(family tree, citizenship, residency and/or employment history) now conflicts\none or more of these requirements, your patch will be totally removed from the\ngit log. No revert commit, no anything. Just undo \u0026 force push.\n\n**NOTICE:** This is a humorous policy that won't actually be applied. Of course,\neveryone who knows me is aware that I, myself, am Russian by nationality. There\nare actual contribution policies like this out in the wild though. I made this\none to poke fun at real anti-Russian discrimination in the open source community\nthat was sparked by the Linux maintainers ban.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fportasynthinca3%2Frandalloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fportasynthinca3%2Frandalloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fportasynthinca3%2Frandalloc/lists"}