Ashet OS

syscall: ashet.process.memory.allocate

Documentation

Allocates a chunk of memory from the process heap.

Inputs

size: usize

The size of the allocated memory block in bytes.

Note:

Passing 0 will never succeed.

ptr_align: u8

The alignment

Outputs

memory: [*]u8

A non-null pointer that points to exactly @ref size bytes.

Note:

In practise, this might point to more than @ref size bytes, but the code must not assume *any* excess bytes may exist.

Errors

SystemResource

Is returned when the system is out of memory.