([ConstantCollection -_collectionReleaseContents]): Use alloca()

instead of malloc() and free().


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1288 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1996-03-29 17:51:07 +00:00
parent e33d2b2595
commit fca9bcfe2f

View file

@ -671,7 +671,7 @@
- (void) _collectionReleaseContents
{
int c = [self count];
id *array = (id*) (*objc_malloc) (c * sizeof(id));
id *array = (id*) alloca (c * sizeof(id));
int i = 0;
void *es = [self newEnumState];
id o;
@ -683,7 +683,6 @@
assert (c == i);
for (i = 0; i < c; i++)
[array[i] release];
(*objc_free) (array);
}
- (void) _collectionDealloc