I'd love to have an alloc method in this package, but I'm not aware of any consensus on how this should be approached in Julia (besides Libc.malloc). Packages with related functionality include Blob.jl, StructIO.jl, and an unregistered ManualMemory.jl package. I'm sure there are others, along with plenty of relevant discussions on Zulip and in other issues.
I'm hoping we can converge on some well-defined goals here for functionality and possibly a path to implementation. So here are some goals I was thinking of:
I'm not entirely sure what this will require. Other packages have plenty of code on how to map memory to julia types that could be built on top of, but I think the only way to allocate memory that the GC is aware of is to use alloca from LLVM, but I never was able to get that to return unique pointers.
Edit: Looks like there's an LLVM based implementation here.
I'd love to have an
allocmethod in this package, but I'm not aware of any consensus on how this should be approached in Julia (besidesLibc.malloc). Packages with related functionality includeBlob.jl,StructIO.jl, and an unregisteredManualMemory.jlpackage. I'm sure there are others, along with plenty of relevant discussions on Zulip and in other issues.I'm hoping we can converge on some well-defined goals here for functionality and possibly a path to implementation. So here are some goals I was thinking of:
Libc.malloc. push!/pop! always does a ccall JuliaLang/julia#24909 (comment)I'm not entirely sure what this will require. Other packages have plenty of code on how to map memory to julia types that could be built on top of, but I think the only way to allocate memory that the GC is aware of is to use
allocafrom LLVM, but I never was able to get that to return unique pointers.Edit: Looks like there's an LLVM based implementation here.