diff options
Diffstat (limited to 'new/uipriv_darwin.h')
| -rw-r--r-- | new/uipriv_darwin.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/new/uipriv_darwin.h b/new/uipriv_darwin.h index 0aa348d..9cb85f9 100644 --- a/new/uipriv_darwin.h +++ b/new/uipriv_darwin.h @@ -8,25 +8,21 @@ #define toNSString(str) [NSString stringWithUTF8String:(str)] #define fromNSString(str) [(str) UTF8String] -// TODO see if we can override alloc instead -#ifdef uiLogAllocations -#import <stdio.h> #define uiLogObjCClassAllocations \ + (id)alloc \ { \ id thing; \ thing = [super alloc]; \ - fprintf(stderr, "%p alloc %s\n", thing, [[self className] UTF8String]); \ + if (options.debugLogAllocations) \ + fprintf(stderr, "%p alloc %s\n", thing, [[self className] UTF8String]); \ return thing; \ } \ - (void)dealloc \ { \ [super dealloc]; \ - fprintf(stderr, "%p free\n", self); \ + if (options.debugLogAllocations) \ + fprintf(stderr, "%p free\n", self); \ } -#else -#define uiLogObjCClassAllocations -#endif // util_darwin.m extern void setStandardControlFont(NSControl *); |
