mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +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
|
||||
{
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue