Skip to main content

function

stack_allocation

stack_allocation[count: Int, type: DType, /, alignment: Int = 1, address_space: AddressSpace = 0]() -> DTypePointer[$1, $3]

Allocates data buffer space on the stack given a data type and number of elements.

Parameters:

  • count (Int): Number of elements to allocate memory for.
  • type (DType): The data type of each element.
  • alignment (Int): Address alignment of the allocated data.
  • address_space (AddressSpace): The address space of the pointer.

Returns:

A data pointer of the given type pointing to the allocated space.

stack_allocation[count: Int, type: AnyRegType, /, alignment: Int = 1, address_space: AddressSpace = 0]() -> LegacyPointer[$1, $3]

Allocates data buffer space on the stack given a data type and number of elements.

Parameters:

  • count (Int): Number of elements to allocate memory for.
  • type (AnyRegType): The data type of each element.
  • alignment (Int): Address alignment of the allocated data.
  • address_space (AddressSpace): The address space of the pointer.

Returns:

A data pointer of the given type pointing to the allocated space.