Blobs.Blob
— TypeA pointer to a T
stored inside a Blob.
Blobs.BlobBitVector
— TypeA fixed-length bit vector whose data is stored in a Blob.
Blobs.BlobString
— TypeA string whose data is stored in a Blob.
Blobs.BlobVector
— TypeA fixed-length vector whose data is stored in a Blob.
Blobs.calloc
— Methodcalloc(::Type{T}, args...)::Blob{T} where T
Allocate a zero-initialized Blob{T}
.
Blobs.child_size
— Methodchild_size(::Type{T}, args...) where {T}
The number of bytes needed to allocate children of T
, not including self_size(T)
.
Defaults to 0.
Blobs.free
— Methodfree(blob::Blob)
Free the underlying allocation for blob
.
Blobs.init
— Methodinit(blob::Blob{T}, free::Blob{Nothing}, args...)::Blob{Nothing} where T
Initialize blob
, where free
is the beginning of the remaining free space. Must return free + child_size(T, args...)
.
The default implementation where child_size(T) == 0
does nothing. Override this method to add custom initializers for your types.
Blobs.init
— Methodinit(blob::Blob{T}, args...) where T
Initialize blob
.
Assumes that blob
it at least self_size(T) + child_size(T, args...)
bytes long.
Blobs.malloc
— Methodmalloc(::Type{T}, args...)::Blob{T} where T
Allocate an uninitialized Blob{T}
.
Blobs.malloc_and_init
— Methodmalloc_and_init(::Type{T}, args...)::Blob{T} where T
Allocate and initialize a new Blob{T}
.
Blobs.self_size
— Methodself_size(::Type{T}, args...) where {T}
The number of bytes needed to allocate T
itself.
Defaults to sizeof(T)
.
Blobs.@a
— Macro@a blob.x[2].y
Get a Blob
pointing at the address of blob.x[2].y
.
Blobs.@v
— Macro@v blob.x[2].y
Get the value at blob.x[2].y
.
@v blob.x[2].y = 42
Set the value at blob.x[2].y
.
NOTE macros bind tightly, so:
# invalid syntax
@v blob.x[2].y < 42
# valid syntax
(@v blob.x[2].y) < 42