PDA

View Full Version : What to do with numbers




Duke Leto
Jan 27, 2009, 07:41 AM
When I deal with numbers (floats, ints, etc.), I feel like there is nothing that I can do to get rid of the memory they are using. Is there a way to deal with things like CGRects, CGPoints, floats, ints, etc?



detz
Jan 27, 2009, 08:21 AM
You don't need to.

firewood
Jan 27, 2009, 11:02 AM
If the numeric stuff is stored in local variables, they are commonly on the stack (or possibly in registers), and will automatically be cleaned up when the subroutine exits. If they are global variables, they are in the process heap, and will automatically be cleaned up after the app is terminated.

If you have pointers to (re)malloc'ed numeric arrays, you may have to clean those up manually to prevent leaks.