summaryrefslogtreecommitdiff
path: root/MLKCompiledClosure.m
diff options
context:
space:
mode:
authorMatthias Benkard <mulk@minimulk.mst-plus>2008-09-28 21:35:04 +0200
committerMatthias Benkard <mulk@minimulk.mst-plus>2008-09-28 21:35:04 +0200
commit45e00ec3f4dd6289cd14021ef1ee35568b4928c6 (patch)
tree8ec0edf60a5d47754ca79ae75be0b78f927d4448 /MLKCompiledClosure.m
parent90a3e20fcfe07c24533cce14e1d1dd8a5d611ed6 (diff)
LLVM compiler: Simplify allocation of closures.
Diffstat (limited to 'MLKCompiledClosure.m')
-rw-r--r--MLKCompiledClosure.m12
1 files changed, 4 insertions, 8 deletions
diff --git a/MLKCompiledClosure.m b/MLKCompiledClosure.m
index 6f61b45..fd643e3 100644
--- a/MLKCompiledClosure.m
+++ b/MLKCompiledClosure.m
@@ -45,18 +45,14 @@
#ifdef __OBJC_GC__
_data = NSAllocateCollectable (dataLength * sizeof(id), NSScannedOption);
- for (i = 0; i < _dataLength; i++)
- {
- _data[i] = data[i];
- }
- free (data);
#else
- _data = data;
+ _data = malloc (dataLength * sizeof(id));
+#endif
+
for (i = 0; i < _dataLength; i++)
{
- LRETAIN (_data[i]);
+ _data[i] = LRETAIN (data[i]);
}
-#endif
return self;
}