Skip to main content
Log in

Mojo function

memset

memset[type: AnyType, address_space: AddressSpace](ptr: UnsafePointer[type, address_space=address_space], value: SIMD[uint8, 1], count: Int)

Fills memory with the given value.

Parameters:

  • type (AnyType): The element dtype.
  • address_space (AddressSpace): The address space of the pointer.

Args:

  • ptr (UnsafePointer[type, address_space=address_space]): UnsafePointer to the beginning of the memory block to fill.
  • value (SIMD[uint8, 1]): The value to fill with.
  • count (Int): Number of elements to fill (in elements, not bytes).