Skip to content

calloc

Declaration

calloc :: fn (num: usize, size: usize) *u8

Description

Allocates count of bytes on heap using default allocator and return pointer to begin of this allocated block. Resulting block is set to 0 value. Use free to free allocated memory when it's no longer needed.

Arguments

  • num Count of items to be allocated.
  • size Item size in bytes.

Result

Pointer to begin of the new allocated block of memory.

Declared in: memory.bl