{"id":26028584,"url":"https://github.com/jeffreysarnoff/alignedallocs.jl","last_synced_at":"2026-06-01T04:31:40.558Z","repository":{"id":279732658,"uuid":"939766181","full_name":"JeffreySarnoff/AlignedAllocs.jl","owner":"JeffreySarnoff","description":"lightweight cross-platform allocation of aligned memory for an n-Vector{T} where isbitstype(T)","archived":false,"fork":false,"pushed_at":"2025-03-06T13:13:15.000Z","size":139,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T13:25:32.590Z","etag":null,"topics":["julia","memory-alignment","memory-allocation"],"latest_commit_sha":null,"homepage":"https://github.com/JeffreySarnoff/AlignedAllocs.jl","language":"Julia","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/JeffreySarnoff.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}},"created_at":"2025-02-27T04:28:17.000Z","updated_at":"2025-03-06T13:17:28.000Z","dependencies_parsed_at":"2025-02-27T05:31:46.891Z","dependency_job_id":"64ee5f37-7d10-41ca-a519-9982f3e57b1c","html_url":"https://github.com/JeffreySarnoff/AlignedAllocs.jl","commit_stats":null,"previous_names":["jeffreysarnoff/alignedalloc.jl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffreySarnoff%2FAlignedAllocs.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffreySarnoff%2FAlignedAllocs.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffreySarnoff%2FAlignedAllocs.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffreySarnoff%2FAlignedAllocs.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JeffreySarnoff","download_url":"https://codeload.github.com/JeffreySarnoff/AlignedAllocs.jl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242250943,"owners_count":20096898,"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":["julia","memory-alignment","memory-allocation"],"created_at":"2025-03-06T17:18:46.131Z","updated_at":"2026-06-01T04:31:40.552Z","avatar_url":"https://github.com/JeffreySarnoff.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AlignedAllocs.jl\n\n[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JeffreySarnoff.github.io/AlignedAllocs.jl/stable/)\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JeffreySarnoff.github.io/AlignedAllocs.jl/dev/)\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)\n\n#### All allocations use the new Memory infrastructure.\n\n## Features\n- `memalign` and `memalign_clear` allocate aligned `Vector{T}` storage, either uninitialised or zeroed.\n- `memaligned` and `memaligned_clear` reshape aligned buffers into multi-dimensional arrays without copying.\n- `memalign_fixed` and `memalign_clear_fixed` build aligned `FixedSizeArrays.jl` containers directly.\n- `alignment(::AbstractArray)` reports the effective pointer alignment at runtime.\n- Cache-line detection with a safe fallback keeps defaults portable across platforms.\n- Precompilation via `PrecompileTools` minimises package load time.\n\n\n## Installation\n```julia\npkg\u003e add AlignedAllocs\n```\nJulia 1.11 or newer is required.\n\n## Quick Start\n```julia\njulia\u003e using AlignedAllocs\n\n# Cache-line aligned Float32 buffer\njulia\u003e xs = memalign(Float32, 256)\n256-element Vector{Float32}:\n 0.0\n 0.0\n #= output truncated =#\n\n# Explicit alignment with zero-initialisation\njulia\u003e ys = memalign_clear(UInt16, 128, 256)\n\n# Multi-dimensional array with aligned storage\njulia\u003e az = memaligned(Float32, 32, 8; align=128)\n32x8 Matrix{Float32}:\n 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0\n 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0\n #= output truncated =#\n\n# Fixed-size array backed by aligned storage\njulia\u003e using FixedSizeArrays\njulia\u003e fs = memalign_fixed(Float32, 16, 4; align=128)\n16x4 FixedSizeArrays.FixedSizeMatrix{Float32}:\n 0.0  0.0  0.0  0.0\n 0.0  0.0  0.0  0.0\n #= output truncated =#\n\n# Inspect alignment guarantee\njulia\u003e alignment(az)\n128\n```\n\n\nSee the [User Guide](https://JeffreySarnoff.github.io/AlignedAllocs.jl/stable/guide/) for workflow examples and the [API Reference](https://JeffreySarnoff.github.io/AlignedAllocs.jl/stable/reference/) for detailed signatures.\n\n## Alignment Guarantees\n- Alignments must be powers of two \u003e= 16 bytes; invalid inputs throw `ArgumentError`.\n- On POSIX systems vectors own the memory returned by `posix_memalign`.\n- On Windows vectors register a finalizer that calls `_aligned_free` when the array is collected.\n- `memalign_clear` preserves the vector while zeroing memory via `Base.memset`.\n\n\n## Development\nRun the test suite with:\n```julia\njulia --project=. -e \"using Pkg; Pkg.test()\"\n```\nDocumentation is built with [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl). See `docs/` for build scripts and source pages.\n\n## License\nMIT License (c) 2025 Jeffrey Sarnoff.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffreysarnoff%2Falignedallocs.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffreysarnoff%2Falignedallocs.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffreysarnoff%2Falignedallocs.jl/lists"}