UnsafeBytes extension type
An owned raw allocation handle.
The handle is an int extension type, so it does not add a Dart object per
allocation. Length is not stored; callers pass it when a view is requested.
- on
Methods
-
free(
) → void - Frees this allocation. Double-free/use-after-free is undefined.
-
getFloat32(
int offset) → double -
getFloat64(
int offset) → double -
getInt16(
int offset) → int -
getInt32(
int offset) → int -
getInt8(
int offset) → int -
getUint16(
int offset) → int -
getUint32(
int offset) → int -
getUint8(
int offset) → int -
setFloat32(
int offset, double value) → void -
setFloat64(
int offset, double value) → void -
setInt16(
int offset, int value) → void -
setInt32(
int offset, int value) → void -
setInt8(
int offset, int value) → void -
setUint16(
int offset, int value) → void -
setUint32(
int offset, int value) → void -
setUint8(
int offset, int value) → void -
slice(
int offset) → UnsafeBytes - Unsafe slice; no bounds check and no ownership transfer.
-
view(
int length) → Uint8List - Zero-copy view; length is caller-supplied.
Static Methods
-
alloc(
int length) → UnsafeBytes -
fromAddress(
int address) → UnsafeBytes - Wraps caller-owned memory. free is undefined for such a handle.