Module: libc.memory

Source: ./libc/memory.reef


Overview

libc.memory - C standard library memory functions (FFI)

Direct access to C's memory allocation and manipulation functions. For pure Reef implementations, use core.memory instead.


Functions

fn c_calloc(count: int, size: int): pointer

fn c_malloc(size: int): pointer

fn c_memcpy(dest: pointer, src: pointer, n: int): pointer

fn c_memset(dest: pointer, c: int, n: int): pointer

fn c_memmove(dest: pointer, src: pointer, n: int): pointer

fn calloc(count: int, size: int): pointer

Allocates memory for an array of count elements of size bytes each Memory is initialized to zero

fn malloc(size: int): pointer

Allocates size bytes of uninitialized memory

fn memcpy(dest: pointer, src: pointer, n: int): pointer

Copies n bytes from src to dest WARNING: src and dest must not overlap (use memmove for overlapping)

fn memset(dest: pointer, c: int, n: int): pointer

Sets n bytes of dest to value c

fn memmove(dest: pointer, src: pointer, n: int): pointer

Copies n bytes from src to dest (handles overlapping regions)


Procedures

proc c_free(ptr: pointer)

proc free(ptr: pointer)

Frees previously allocated memory


Generated by reefc doc