From 90a3e20fcfe07c24533cce14e1d1dd8a5d611ed6 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Sun, 28 Sep 2008 21:28:56 +0200 Subject: Use GC-aware allocation instead of malloc(3) where appropriate. --- MLKForm.m | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'MLKForm.m') diff --git a/MLKForm.m b/MLKForm.m index 674181b..c7ee3f5 100644 --- a/MLKForm.m +++ b/MLKForm.m @@ -26,6 +26,10 @@ #import #import +#ifdef __OBJC_GC__ +#import +#endif + #include #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]); -- cgit v1.2.3