17.05.2015 Views

TMS34010 C Compiler - Al Kossow's Bitsavers

TMS34010 C Compiler - Al Kossow's Bitsavers

TMS34010 C Compiler - Al Kossow's Bitsavers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

free<br />

Deallocate Memory<br />

Syntax #include <br />

Defined in<br />

Description<br />

Example<br />

void free(ptr}<br />

void *ptr;<br />

memory. c in rts. src<br />

The free function deallocates memory space (pointed to by ptr) that was<br />

previously allocated by a malloc, calloc, or realloc call. This makes the<br />

memory space available again. If you attempt to free unallocated space, the<br />

function takes no action and returns. For more information, see Section<br />

5.1 .3, Dynamic Memory <strong>Al</strong>location, on page 5-4.<br />

This example allocates 10 bytes and then frees them.<br />

char *x;<br />

x = malloc(lO);<br />

free (x) ;<br />

/* allocate 10 bytes<br />

/* free 10 bytes<br />

*/<br />

*/<br />

6-40

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

Saved successfully!

Ooh no, something went wrong!