summaryrefslogtreecommitdiff
path: root/MLKForm.m
diff options
context:
space:
mode:
authorMatthias Benkard <mulk@minimulk.mst-plus>2008-09-28 21:28:56 +0200
committerMatthias Benkard <mulk@minimulk.mst-plus>2008-09-28 21:28:56 +0200
commit90a3e20fcfe07c24533cce14e1d1dd8a5d611ed6 (patch)
treea677508c98400fc2d3ea5d06189cca0b3ca1f7f9 /MLKForm.m
parent31eed182d7996b7dbc319bd5f2c474a734492b04 (diff)
Use GC-aware allocation instead of malloc(3) where appropriate.
Diffstat (limited to 'MLKForm.m')
-rw-r--r--MLKForm.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/MLKForm.m b/MLKForm.m
index 674181b..c7ee3f5 100644
--- a/MLKForm.m
+++ b/MLKForm.m
@@ -26,6 +26,10 @@
#import <Foundation/NSSet.h>
#import <Foundation/NSString.h>
+#ifdef __OBJC_GC__
+#import <Foundation/NSZone.h>
+#endif
+
#include <stdlib.h>
#define MAKE_FORM(OBJECT) \
@@ -489,7 +493,13 @@
argtypes = [[[_tail cdr] cdr] car];
_argc = [argtypes length];
+
+#ifdef __OBJC_GC__
+ _argumentTypes = NSAllocateCollectable (_argc * sizeof (MLKForeignType), NSScannedOption);
+#else
_argumentTypes = malloc (_argc * sizeof (MLKForeignType));
+#endif
+
while (argtypes)
{
_argumentTypes[i] = MLKForeignTypeWithTypeDesignator ([argtypes car]);