Blobs.BlobType

A pointer to a T stored inside a Blob.

Blobs.callocMethod
calloc(::Type{T}, args...)::Blob{T} where T

Allocate a zero-initialized Blob{T}.

Blobs.child_sizeMethod
child_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.freeMethod
free(blob::Blob)

Free the underlying allocation for blob.

Blobs.initMethod
init(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.initMethod
init(blob::Blob{T}, args...) where T

Initialize blob.

Assumes that blob it at least self_size(T) + child_size(T, args...) bytes long.

Blobs.mallocMethod
malloc(::Type{T}, args...)::Blob{T} where T

Allocate an uninitialized Blob{T}.

Blobs.malloc_and_initMethod
malloc_and_init(::Type{T}, args...)::Blob{T} where T

Allocate and initialize a new Blob{T}.

Blobs.self_sizeMethod
self_size(::Type{T}, args...) where {T}

The number of bytes needed to allocate T itself.

Defaults to sizeof(T).

Blobs.@aMacro
@a blob.x[2].y

Get a Blob pointing at the address of blob.x[2].y.

Blobs.@vMacro
@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