summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MLKBinaryStreamCharacterStream.m2
-rw-r--r--MLKCompiledClosure.m15
-rw-r--r--MLKForeignProcedure.h1
-rw-r--r--MLKForeignProcedure.m14
-rw-r--r--MLKForm.m10
5 files changed, 33 insertions, 9 deletions
diff --git a/MLKBinaryStreamCharacterStream.m b/MLKBinaryStreamCharacterStream.m
index 6fc7119..4efe6e7 100644
--- a/MLKBinaryStreamCharacterStream.m
+++ b/MLKBinaryStreamCharacterStream.m
@@ -66,7 +66,7 @@
{
retval = [tmpstr characterAtIndex:0];
[tmpstr release];
- //free (buffer);
+ //FIXME: ? free (buffer);
return retval;
}
else
diff --git a/MLKCompiledClosure.m b/MLKCompiledClosure.m
index 9227008..6f61b45 100644
--- a/MLKCompiledClosure.m
+++ b/MLKCompiledClosure.m
@@ -26,6 +26,10 @@
#import <Foundation/NSDictionary.h>
#import <Foundation/NSSet.h>
+#ifdef __OBJC_GC__
+#import <Foundation/NSZone.h>
+#endif
+
#import <stdlib.h>
@@ -36,14 +40,23 @@
{
int i;
- _data = data;
_dataLength = dataLength;
_code = code;
+#ifdef __OBJC_GC__
+ _data = NSAllocateCollectable (dataLength * sizeof(id), NSScannedOption);
+ for (i = 0; i < _dataLength; i++)
+ {
+ _data[i] = data[i];
+ }
+ free (data);
+#else
+ _data = data;
for (i = 0; i < _dataLength; i++)
{
LRETAIN (_data[i]);
}
+#endif
return self;
}
diff --git a/MLKForeignProcedure.h b/MLKForeignProcedure.h
index 160bb7c..cb63d32 100644
--- a/MLKForeignProcedure.h
+++ b/MLKForeignProcedure.h
@@ -43,5 +43,4 @@
-(NSString *) descriptionForLisp;
-(void) dealloc;
--(void) finalize;
@end
diff --git a/MLKForeignProcedure.m b/MLKForeignProcedure.m
index ce4ac8a..f268005 100644
--- a/MLKForeignProcedure.m
+++ b/MLKForeignProcedure.m
@@ -23,6 +23,10 @@
#import <Foundation/NSArray.h>
#import <Foundation/NSEnumerator.h>
+#ifdef __OBJC_GC__
+#import <Foundation/NSZone.h>
+#endif
+
#ifdef HAVE_FFI_H
#include <ffi.h>
#elif HAVE_FFI_FFI_H
@@ -47,7 +51,11 @@
_code = code;
_returnType = returnType;
+#ifdef __OBJC_GC__
+ _argumentTypes = NSAllocateCollectable (sizeof (MLKForeignType) * [argTypes count], NSScannedOption);
+#else
_argumentTypes = malloc (sizeof (MLKForeignType) * [argTypes count]);
+#endif
e = [argTypes objectEnumerator];
i = 0;
@@ -113,10 +121,4 @@
free (_argumentTypes);
[super dealloc];
}
-
--(void) finalize
-{
- free (_argumentTypes);
- [super finalize];
-}
@end
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]);