In XINU routines are provided for allocating storage for the heap and
the stack. There are two routines each:
getmem(nbytes) allocates nbytes of dynamic storage (heap storage)
freemem(block, size) frees a block of memory (starting at address
block that was previously allocated using getmem().
getstk(nbytes) allocates stack space for a new process.
freestk(ptr, len) frees a stack that was previously allocated
using getstk().
The stack allocation and freeing routines are only ever called during
process creation and destruction. The heap allocation and freeing routines
can be called at anytime by the O/S or by an application.