• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: I think I get most of the memory stuff but...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I think I get most of the memory stuff but...


  • Subject: Re: I think I get most of the memory stuff but...
  • From: Jim Rankin <email@hidden>
  • Date: Thu, 8 May 2003 12:02:35 -0400

On Monday, May 5, 2003, at 10:03 AM, Marco Scheurer wrote:

Huh, what's with do {...} while (0)? I feel like I'm missing something basic here ... ?

Best,
-jimbo

This is how our ASSIGN macro is defined:

#if defined (GNUSTEP)
// GNUstep has its own definitions of ASSIGN and RETAIN
#else
#define RETAIN(var,val) \
do { \
id newVal = (val); \
if (var != newVal) { \
if (var) { \
[var release]; \
} \
if (newVal) { \
[newVal retain]; \
} \
var = newVal; \
} \
} while (0)

#if defined(GARBAGE_COLLECTION)
#define ASSIGN(var,val) \
do { \
var = val; \
} while (0)
#else
#define ASSIGN RETAIN
#endif
#endif
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: I think I get most of the memory stuff but...
      • From: Marco Scheurer <email@hidden>
References: 
 >Re: I think I get most of the memory stuff but... (From: Marco Scheurer <email@hidden>)

  • Prev by Date: Re: weird problem ...
  • Next by Date: messages to nil
  • Previous by thread: Re: I think I get most of the memory stuff but...
  • Next by thread: Re: I think I get most of the memory stuff but...
  • Index(es):
    • Date
    • Thread