new_memory

Synopsis

    #include "nortlib.h"
    void *new_memory(size_t size);
    void nl_free_memory(void *p);
    

Description

new_memory() is a thin cover for malloc() that guarantees a non-NULL return. If memory allocation fails, new_memory() will terminate the program by calling nl_error(3).

Returns

Returns a newly allocated copy of the argument string. If memory allocation fails, the program will terminate via nl_error(3).

new_memory() uses the same name as a function in the memlib library which provides more sophisticated memory allocation strategies, including hooks for garbage collection or a limited form of virtual memory.

nl_free_memory() is an extremely thin cover for free().

See Also

nl_response, nl_strdup().

Source File

/usr/local/src/nortlib/newmem.c

Alphabetical List
Subject List
Return to Manuals Page
webmaster@huarp.harvard.edu
Copyright 2001 by the President and Fellows of Harvard College