What to do with numbers

Discussion in 'iOS Programming' started by Duke Leto, Jan 27, 2009.

  1. Duke Leto macrumors regular

    Joined:
    Mar 17, 2008
    #1
    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?
     
  2. detz macrumors 65816

    Joined:
    Jun 29, 2007
  3. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #3
    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.
     

Share This Page