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.

Passing 0 will never succeed.

ptr_align: u8

The alignment

Outputs

memory: [*]u8

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

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

Errors

SystemResource

Is returned when the system is out of memory.