https://github.com/juliasimd/manualmemory.jl
Manual memory management utilities.
https://github.com/juliasimd/manualmemory.jl
Last synced: 10 months ago
JSON representation
Manual memory management utilities.
- Host: GitHub
- URL: https://github.com/juliasimd/manualmemory.jl
- Owner: JuliaSIMD
- License: mit
- Created: 2021-06-04T06:37:42.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-18T23:18:05.000Z (over 1 year ago)
- Last Synced: 2025-10-21T11:55:07.924Z (10 months ago)
- Language: Julia
- Size: 139 KB
- Stars: 34
- Watchers: 4
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ManualMemory
[](https://JuliaSIMD.github.io/ManualMemory.jl/stable)
[](https://JuliaSIMD.github.io/ManualMemory.jl/dev)
[](https://github.com/JuliaSIMD/ManualMemory.jl/actions/workflows/CI.yml)
[](https://codecov.io/gh/JuliaSIMD/ManualMemory.jl)
Manually managed memory buffers backed by NTuples
### Examples
```julia
julia> using ManualMemory: MemoryBuffer, load, store!, LazyPreserve, preserve, PseudoPtr, Reference
julia> m = MemoryBuffer{4,Float64}(undef)
MemoryBuffer{4, Float64}((2.283825594e-314, 2.2157350003e-314, 2.216358792e-314, 2.08e-322))
julia> store!(pointer(m), 1.23)
julia> load(pointer(m))
1.23
```
Specifying an existing `NTuple` of data:
```julia
julia> s = (1,2,3,4,5);
julia> m = MemoryBuffer(s)
MemoryBuffer{5, Int64}((1, 2, 3, 4, 5))
julia> load(p)
1
julia> load(p+sizeof(Int64))
2
julia> load(p+sizeof(Int64)*2)
3
```