I'm not sure there's much advantage to me letting people wrap whatever type like like for this thing. Might be better to simply do:
mutable struct AllocBuffer
ptr::Ptr{UInt8}
length::Int
offset::UInt8
end
function AllocBuffer(length::Int; finalize=true)
ptr = malloc(length)
out = AllocBuffer(ptr, length, UInt(0))
if finalize
finalizer(x -> free(x.ptr), out)
end
out
end
which'd make it more similar to SlabBuffer. This'd be a breaking change, so I'd like to do it before 1.0 if I do it.
I'm not sure there's much advantage to me letting people wrap whatever type like like for this thing. Might be better to simply do:
which'd make it more similar to
SlabBuffer
. This'd be a breaking change, so I'd like to do it before 1.0 if I do it.