Mercurial > projects > dstep
annotate dstep/foundation/NSZone.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.NSZone; | |
8 | |
9 import dstep.corefoundation.CFBase; | |
10 import dstep.foundation.NSObjCRuntime; | |
11 import dstep.foundation.NSString; | |
12 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
13 import dstep.objc.objc; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
14 import bindings = dstep.foundation.NSZone_bindings; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
15 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
16 struct _NSZone; |
14 | 17 |
18 alias _NSZone NSZone; | |
19 | |
20 enum | |
21 { | |
22 NSScannedOption = (1<<0), | |
23 NSCollectorDisabledOption = (1<<1) | |
24 } | |
25 | |
26 void NSSetZoneName (NSZone* zone, NSString name) | |
27 { | |
28 return Bridge.invokeObjcFunction!(void, bindings.NSSetZoneName, NSZone*, NSString)(zone, name); | |
29 } | |
30 | |
31 NSString NSZoneName (NSZone* zone) | |
32 { | |
33 return Bridge.invokeObjcFunction!(NSString, bindings.NSZoneName, NSZone*)(zone); | |
34 } | |
35 | |
36 extern (C) | |
37 { | |
38 NSZone* NSDefaultMallocZone (); | |
39 NSZone* NSCreateZone (NSUInteger startSize, NSUInteger granularity, bool canFree); | |
40 void NSRecycleZone (NSZone* zone); | |
41 NSZone* NSZoneFromPointer (void* ptr); | |
42 void* NSZoneMalloc (NSZone* zone, NSUInteger size); | |
43 void* NSZoneCalloc (NSZone* zone, NSUInteger numElems, NSUInteger byteSize); | |
44 void* NSZoneRealloc (NSZone* zone, void* ptr, NSUInteger size); | |
45 void NSZoneFree (NSZone* zone, void* ptr); | |
46 void* NSAllocateCollectable (NSUInteger size, NSUInteger options); | |
47 void* NSReallocateCollectable (void* ptr, NSUInteger size, NSUInteger options); | |
48 NSUInteger NSPageSize (); | |
49 NSUInteger NSLogPageSize (); | |
50 NSUInteger NSRoundUpToMultipleOfPageSize (NSUInteger bytes); | |
51 NSUInteger NSRoundDownToMultipleOfPageSize (NSUInteger bytes); | |
52 void* NSAllocateMemoryPages (NSUInteger bytes); | |
53 void NSDeallocateMemoryPages (void* ptr, NSUInteger bytes); | |
54 void NSCopyMemoryPages (void* source, void* dest, NSUInteger bytes); | |
55 NSUInteger NSRealMemoryAvailable (); | |
56 } |