02.07.2013 Views

A/UX® Programmer's Reference Sections

A/UX® Programmer's Reference Sections

A/UX® Programmer's Reference Sections

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

malloe(3X) malloe(3X)<br />

NAME<br />

malloe, free, realloe, ealloe, mallopt,<br />

mallinfo - fast main memory allocator<br />

SYNOPSIS<br />

iinelude <br />

ehar *malloe (size)<br />

unsigned size;<br />

void free (ptr)<br />

ehar *ptr;<br />

ehar * realloe (ptr, size)<br />

ehar *ptr;<br />

unsigned size;<br />

ehar *ealloe (nelem, elsize)<br />

unsigned nelem, elsize;<br />

int mallopt (cmd, value)<br />

int cmd, value;<br />

struet mallinfo mallinfo(max)<br />

int max;<br />

DESCRIPTION<br />

malloe and free provide a simple general-purpose memory allocation<br />

package, which runs considerably faster than the<br />

malloe(3C) package. It is found in the library "malloe", and<br />

is loaded if the option "-lmalloe" is used with ee(l) or ld(l).<br />

malloe returns a pointer to a block of at least size bytes suitably<br />

aligned for any use.<br />

The argument to free is a pointer to a block previously allocated<br />

by malloe; after free is performed this space is made available<br />

for further allocation, and its contents have been destroyed (but<br />

see mallopt below for a way to change this behavior).<br />

Undefined results will occur if the space assigned by malloe is<br />

overrun or if some random number is handed to free.<br />

realloe changes the size of the block pointed to by ptr to size<br />

bytes and returns a pointer to the (possibly moved) block. The<br />

contents will be unchanged up to the lesser of the new and old<br />

sizes.<br />

February, 1990<br />

RevisionC<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!