mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
([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:
parent
e33d2b2595
commit
fca9bcfe2f
1 changed files with 1 additions and 2 deletions
|
@ -671,7 +671,7 @@
|
||||||
- (void) _collectionReleaseContents
|
- (void) _collectionReleaseContents
|
||||||
{
|
{
|
||||||
int c = [self count];
|
int c = [self count];
|
||||||
id *array = (id*) (*objc_malloc) (c * sizeof(id));
|
id *array = (id*) alloca (c * sizeof(id));
|
||||||
int i = 0;
|
int i = 0;
|
||||||
void *es = [self newEnumState];
|
void *es = [self newEnumState];
|
||||||
id o;
|
id o;
|
||||||
|
@ -683,7 +683,6 @@
|
||||||
assert (c == i);
|
assert (c == i);
|
||||||
for (i = 0; i < c; i++)
|
for (i = 0; i < c; i++)
|
||||||
[array[i] release];
|
[array[i] release];
|
||||||
(*objc_free) (array);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) _collectionDealloc
|
- (void) _collectionDealloc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue