Re: I think I get most of the memory stuff but...
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.