{"id":19664853,"url":"https://github.com/fluxml/alloc.jl","last_synced_at":"2025-08-16T12:08:56.577Z","repository":{"id":85754001,"uuid":"143290267","full_name":"FluxML/Alloc.jl","owner":"FluxML","description":null,"archived":false,"fork":false,"pushed_at":"2020-02-17T13:18:25.000Z","size":13,"stargazers_count":27,"open_issues_count":2,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-27T03:50:04.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","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/FluxML.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}},"created_at":"2018-08-02T12:14:25.000Z","updated_at":"2024-11-27T11:28:45.000Z","dependencies_parsed_at":"2023-03-13T06:34:14.002Z","dependency_job_id":null,"html_url":"https://github.com/FluxML/Alloc.jl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FluxML/Alloc.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FAlloc.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FAlloc.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FAlloc.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FAlloc.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FluxML","download_url":"https://codeload.github.com/FluxML/Alloc.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluxML%2FAlloc.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270709023,"owners_count":24631992,"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-08-16T02:00:11.002Z","response_time":91,"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":[],"created_at":"2024-11-11T16:19:17.175Z","updated_at":"2025-08-16T12:08:56.554Z","avatar_url":"https://github.com/FluxML.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alloc.jl\n\nAlloc.jl makes Julia's memory allocator customisable. Currently it provides the ability to bump allocate everything within a block of code.\n\n```julia\njulia\u003e using IRTools\n\njulia\u003e using Alloc: Buffer, run, profile\n\njulia\u003e function f()\n         x = rand(100, 100)\n         y = rand(100)\n         x*y\n       end\nf (generic function with 1 method)\n\njulia\u003e @allocated f()\n81872\n\njulia\u003e profile(f); # Figure out how big our buffer should be\n[ Info: Allocated 81600 bytes\n\njulia\u003e const buf = Buffer(10^6);\n\njulia\u003e @allocated run(f, buf)\n1280\n```\n\nThe bump allocator has the downside that no memory is ever freed until `f` is finished. The advantage is that allocation is _really_ fast (effectively the same as stack allocation of arrays), so if your memory usage is reasonably predictable you can just bump allocate within your main loop.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluxml%2Falloc.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluxml%2Falloc.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluxml%2Falloc.jl/lists"}