Mercurial > projects > dstep
annotate dstep/foundation/NSDebug.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | 89f3c3ef1fd2 |
children |
rev | line source |
---|---|
14 | 1 /** |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Aug 3, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.foundation.NSDebug; | |
8 | |
9 import dstep.foundation.NSAutoreleasePool; | |
10 import dstep.foundation.NSDate; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
11 import dstep.foundation.NSObjCRuntime; |
14 | 12 import dstep.foundation.NSObject; |
13 import dstep.foundation.NSPort; | |
14 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
15 import dstep.objc.objc; |
14 | 16 |
17 import bindings = dstep.foundation.NSDebug_bindings; | |
18 | |
19 extern (C) | |
20 { | |
21 extern | |
22 { | |
23 bool NSDebugEnabled; | |
24 bool NSZombieEnabled; | |
25 bool NSDeallocateZombies; | |
26 bool NSHangOnUncaughtException; | |
27 bool NSKeepAllocationStatistics; | |
28 } | |
29 } | |
30 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
31 const TNSAutoreleasePoolDebugging = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
32 |
14 | 33 static void enableRelease (bool enable) |
34 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
35 return invokeObjcSuperClass!(void, "enableRelease:", bool)(enable); |
14 | 36 } |
37 | |
38 static void showPools () | |
39 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
40 return invokeObjcSuperClass!(void, "showPools"); |
14 | 41 } |
42 | |
43 static void resetTotalAutoreleasedObjects () | |
44 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
45 return invokeObjcSuperClass!(void, "resetTotalAutoreleasedObjects"); |
14 | 46 } |
47 | |
48 static NSUInteger totalAutoreleasedObjects () | |
49 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
50 return invokeObjcSuperClass!(NSUInteger, "totalAutoreleasedObjects"); |
14 | 51 } |
52 | |
53 static void enableFreedObjectCheck (bool enable) | |
54 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
55 return invokeObjcSuperClass!(void, "enableFreedObjectCheck:", bool)(enable); |
14 | 56 } |
57 | |
58 static NSUInteger autoreleasedObjectCount () | |
59 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
60 return invokeObjcSuperClass!(NSUInteger, "autoreleasedObjectCount"); |
14 | 61 } |
62 | |
63 static NSUInteger topAutoreleasePoolCount () | |
64 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
65 return invokeObjcSuperClass!(NSUInteger, "topAutoreleasePoolCount"); |
14 | 66 } |
67 | |
68 static NSUInteger poolCountHighWaterMark () | |
69 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
70 return invokeObjcSuperClass!(NSUInteger, "poolCountHighWaterMark"); |
14 | 71 } |
72 | |
73 static void setPoolCountHighWaterMark (NSUInteger count) | |
74 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
75 return invokeObjcSuperClass!(void, "setPoolCountHighWaterMark:", NSUInteger)(count); |
14 | 76 } |
77 | |
78 static NSUInteger poolCountHighWaterResolution () | |
79 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
80 return invokeObjcSuperClass!(NSUInteger, "poolCountHighWaterResolution"); |
14 | 81 } |
82 | |
83 static void setPoolCountHighWaterResolution (NSUInteger res) | |
84 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
85 return invokeObjcSuperClass!(void, "setPoolCountHighWaterResolution:", NSUInteger)(res); |
14 | 86 } |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
87 `; |
14 | 88 |
89 bool NSIsFreedObject (Object anObject) | |
90 { | |
91 return Bridge.invokeObjcFunction!(bool, bindings.NSIsFreedObject, Object)(anObject); | |
92 } | |
93 | |
94 void NSRecordAllocationEvent (int eventType, Object object) | |
95 { | |
96 return Bridge.invokeObjcFunction!(void, bindings.NSRecordAllocationEvent, int, Object)(eventType, object); | |
97 } | |
98 | |
99 extern (C) | |
100 { | |
101 void* NSFrameAddress (NSUInteger frame); | |
102 void* NSReturnAddress (NSUInteger frame); | |
103 NSUInteger NSCountFrames (); | |
104 void _NSAutoreleaseNoPool (void* object); | |
105 void _NSAutoreleaseFreedObject (void* freedObject); | |
106 void _NSAutoreleaseHighWaterLog (NSUInteger count); | |
107 } |