alloc(3) alloc(3) NNAAMMEE alloc - allocate memory SSYYNNTTAAXX ##iinncclluuddee <> char *aalllloocc(_n_e_w); void aalllloocc__ffrreeee(_x); void aalllloocc__rree(&_x,_o_l_d,_n_e_w); char *_x; unsigned int _o_l_d; unsigned int _n_e_w; DDEESSCCRRIIPPTTIIOONN aalllloocc allocates enough space from the heap for _n_e_w bytes of data, ade- quately aligned for any data type. _n_e_w may be 0. aalllloocc returns a pointer to the space. If space is not available, aalllloocc returns 0, set- ting eerrrrnnoo appropriately. aalllloocc__ffrreeee returns space to the heap. aalllloocc__rree expands the space allocated to _x from _o_l_d bytes to _n_e_w bytes. It allocates new space, copies _o_l_d bytes from the old space to the new space, returns the old space to the heap, and changes _x to point to the new space. It then returns 1. If space is not available, aalllloocc__rree returns 0, leaving the old space alone. SSEEEE AALLSSOO sbrk(2), malloc(3), error(3) alloc(3)