C
class provides low-level memory manipulation functionality.
With it, a lot of collection and string methods can be written in TOM
instead of needing to be written in C.
void free pointer address;
address
.
pointer malloc int length;
length
bytes.
pointer calloc (int, int) (num, bytes);
num
elements of each bytes
size.
pointer realloc (pointer, int) (address, length);
address
which
must hold length
bytes. The address returned can differ from the
previous address
.
int memcmp (pointer, pointer, int) (one, other, length);
length
bytes at one
equal the bytes at other
.
pointer memcpy (pointer, pointer, int) (to, from, length);
length
bytes from from
to to
. Return to
.
pointer memmove (pointer, pointer, int) (to, from, length);
length
bytes from from
to to
, safely. Return to
.
void bzero (pointer, int) (p, num);
num
bytes at p
to 0.
C
instance can be and is totally empty.