summaryrefslogtreecommitdiff
path: root/new/uipriv_darwin.h
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-09 22:38:11 -0400
committerPietro Gagliardi <[email protected]>2015-04-09 22:38:11 -0400
commit50a227058a8d72f1fb885458b882cedb0e0d7f79 (patch)
treec68e86810a6036645278b707430532d9f767c7cc /new/uipriv_darwin.h
parentd9315e6d8f528840dd396fbbeb96cb22c8a5df98 (diff)
Changed the allocation logging from a compile-time setting to the first initialization option.
Diffstat (limited to 'new/uipriv_darwin.h')
-rw-r--r--new/uipriv_darwin.h12
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 *);