зеркало из https://github.com/mozilla/gecko-dev.git
Don't allocate sieve from stack on machines with very-limited stacks.
Bug 115012. Patch from Michael Kaply mkaply@us.ibm.com
This commit is contained in:
Родитель
37db3590b6
Коммит
9af2ddfe10
|
@ -427,7 +427,7 @@ mp_err mpp_make_prime(mp_int *start, mp_size nBits, mp_size strong,
|
||||||
* Mac builds don't break by adding an extra variable
|
* Mac builds don't break by adding an extra variable
|
||||||
* on the stack. -javi
|
* on the stack. -javi
|
||||||
*/
|
*/
|
||||||
#ifdef macintosh
|
#if defined(macintosh) || defined (XP_OS2)
|
||||||
unsigned char *sieve;
|
unsigned char *sieve;
|
||||||
|
|
||||||
sieve = malloc(SIEVE_SIZE);
|
sieve = malloc(SIEVE_SIZE);
|
||||||
|
@ -569,7 +569,7 @@ CLEANUP:
|
||||||
mp_clear(&q);
|
mp_clear(&q);
|
||||||
if (nTries)
|
if (nTries)
|
||||||
*nTries += i;
|
*nTries += i;
|
||||||
#ifdef macintosh
|
#if defined(macintosh) || defined(XP_OS2)
|
||||||
if (sieve != NULL) {
|
if (sieve != NULL) {
|
||||||
memset(sieve, 0, SIEVE_SIZE);
|
memset(sieve, 0, SIEVE_SIZE);
|
||||||
free (sieve);
|
free (sieve);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче