A89: Re: malloc/free question


[Prev][Next][Index][Thread]

A89: Re: malloc/free question




> In most C implementations, memory that is not explicitly freed by the
> program will be deallocated when the program terminates. Is this true for
> TI-GCC programs? Or will it cause persistent memory leaks (lasting after the
> program terminates) if I don't free my memory?

I think it's true for programs that run through a shell like DoorsOS which,
IIRC, de-allocates any memory blocks that remain when a program terminates. I'm
not quite sure how though (just remembering the highest handle doesn't work).

In nostub programs you have to free all memory manually (unless you want to
re-use the same memory block the next time for highscores or something).

--
 / Niklas Brunlid
Check out Prosit for the TI-89 / TI-92+ at http://prosit.ticalc.org
Random PQF v5.1 Quote follows:

"What's a philosopher ?" said Brutha.
"Someone who's bright enough to find a job with no heavy lifting,"
said a voice in his head.
        -- (Terry Pratchett, Small Gods)





Follow-Ups: References: