mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
([Collection -_safeWithElementsCallNoRetain:]): Use malloc not alloca.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@455 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a578d2b436
commit
5ee18261b4
1 changed files with 2 additions and 1 deletions
|
@ -68,7 +68,7 @@
|
|||
- (void) _safeWithElementsCallNoRetain: (void(*)(elt))aFunc
|
||||
{
|
||||
int c = [self count];
|
||||
elt *elts = (elt*) alloca(c * sizeof(elt));
|
||||
elt *elts = (elt*) (*objc_malloc) (c * sizeof(elt));
|
||||
int i = 0;
|
||||
void fill_elts(elt e)
|
||||
{
|
||||
|
@ -77,6 +77,7 @@
|
|||
[self withElementsCall:fill_elts];
|
||||
for (i = 0; i < c; i++)
|
||||
aFunc(elts[i]);
|
||||
(*objc_free) (elts);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue