/* The low level system call upon which malloc is built. 
If we run out of memory, a message is printed and abort() is called. */
caddr_t _sbrk(int nbytes)
/* The low level system call upon which malloc is built. 
If we run out of memory, a message is printed and abort() is called. */
caddr_t _sbrk(int nbytes)
{
    static caddr_t heap_ptr = NULL;
    caddr_t base;
    if (heap_ptr == NULL)
    {
        heap_ptr = (caddr_t)&free_memory_start;
    }
    base = heap_ptr;
    heap_ptr += nbytes;
    if (heap_ptr > (caddr_t)&free_memory_end)
    {
        _write(1, "** Heap ran out of memory! **\n", 24);
        abort();
    }
    return base;
}