summaryrefslogtreecommitdiff
path: root/MLKCompiledClosure.m
diff options
context:
space:
mode:
authorMatthias Benkard <mulk@minimulk.mst-plus>2008-10-01 17:28:07 +0200
committerMatthias Benkard <mulk@minimulk.mst-plus>2008-10-01 17:28:07 +0200
commita0dae1a2756c0f9a84c3a258f3a4a05e63afc1c6 (patch)
tree6f6b0ee50b8123d3d559f11c27f2e1a06f2851d4 /MLKCompiledClosure.m
parent922d23c9daafbda42596086757291ae5af914c68 (diff)
Support %FLET on the GNU runtime and pre-10.5 versions of Mac OS X.
Diffstat (limited to 'MLKCompiledClosure.m')
-rw-r--r--MLKCompiledClosure.m26
1 files changed, 13 insertions, 13 deletions
diff --git a/MLKCompiledClosure.m b/MLKCompiledClosure.m
index fd643e3..b379dd3 100644
--- a/MLKCompiledClosure.m
+++ b/MLKCompiledClosure.m
@@ -40,18 +40,18 @@
{
int i;
- _dataLength = dataLength;
- _code = code;
+ m_dataLength = dataLength;
+ m_code = code;
#ifdef __OBJC_GC__
- _data = NSAllocateCollectable (dataLength * sizeof(id), NSScannedOption);
+ m_data = NSAllocateCollectable (dataLength * sizeof(id), NSScannedOption);
#else
- _data = malloc (dataLength * sizeof(id));
+ m_data = malloc (dataLength * sizeof(id));
#endif
- for (i = 0; i < _dataLength; i++)
+ for (i = 0; i < m_dataLength; i++)
{
- _data[i] = LRETAIN (data[i]);
+ m_data[i] = LRETAIN (data[i]);
}
return self;
@@ -76,7 +76,7 @@
int i;
arg_types[0] = &ffi_type_pointer;
- argv[0] = &_data;
+ argv[0] = &m_data;
for (i = 1; i < argc - 1; i++)
{
@@ -101,7 +101,7 @@
// NSLog (@"Argument %d: %p", i, *((void**)argv[i]));
// }
- ffi_call (&cif, FFI_FN (_code), &return_value, (void**)argv);
+ ffi_call (&cif, FFI_FN (m_code), &return_value, (void**)argv);
// return_value = ((id (*)(void *, ...))_code) (_data, argpointers[0], argpointers[1], MLKEndOfArgumentsMarker);
// FIXME: multiple values
@@ -120,12 +120,12 @@
-(id (*)()) code
{
- return _code;
+ return m_code;
}
-(void *) closureData
{
- return _data;
+ return m_data;
}
-(void) dealloc
@@ -135,10 +135,10 @@
[super dealloc];
// FIXME: Decrease refcount of _code.
- for (i = 0; i < _dataLength; i++)
+ for (i = 0; i < m_dataLength; i++)
{
- LRELEASE (_data[i]);
+ LRELEASE (m_data[i]);
}
- free (_data);
+ free (m_data);
}
@end