From 50a227058a8d72f1fb885458b882cedb0e0d7f79 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 9 Apr 2015 22:38:11 -0400 Subject: Changed the allocation logging from a compile-time setting to the first initialization option. --- new/uipriv_darwin.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'new/uipriv_darwin.h') 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 #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 *); -- cgit v1.2.3