Skip to main content

Mojo module

unsafe_pointer

Aliases

ImmutOpaquePointer

comptime ImmutOpaquePointer[origin: ImmutOrigin, *, address_space: AddressSpace = AddressSpace.GENERIC] = UnsafePointer[NoneType, origin, address_space=address_space]

An immutable opaque pointer, equivalent to the C const void* type.

Parameters

ImmutUnsafePointer

comptime ImmutUnsafePointer[type: AnyType, origin: ImmutOrigin, *, address_space: AddressSpace = AddressSpace.GENERIC] = UnsafePointer[type, origin, address_space=address_space]

An immutable unsafe pointer.

Parameters

MutOpaquePointer

comptime MutOpaquePointer[origin: MutOrigin, *, address_space: AddressSpace = AddressSpace.GENERIC] = UnsafePointer[NoneType, origin, address_space=address_space]

A mutable opaque pointer, equivalent to the C void* type.

Parameters

MutUnsafePointer

comptime MutUnsafePointer[type: AnyType, origin: MutOrigin, *, address_space: AddressSpace = AddressSpace.GENERIC] = UnsafePointer[type, origin, address_space=address_space]

A mutable unsafe pointer.

Parameters

OpaquePointer

comptime OpaquePointer[mut: Bool, //, origin: Origin[mut], *, address_space: AddressSpace = AddressSpace.GENERIC] = UnsafePointer[NoneType, origin, address_space=address_space]

An opaque pointer, equivalent to the C (const) void* type.

Parameters

Structs

  • UnsafePointer: UnsafePointer represents an indirect reference to one or more values of type T consecutively in memory, and can refer to uninitialized memory.

Functions

  • alloc: Allocates contiguous storage for count elements of type with alignment alignment.

Was this page helpful?