From: Alexandre Oliva Date: Wed, 5 Sep 2012 18:43:04 +0000 (-0300) Subject: Don't change no_dyn_threshold on mallopt failure X-Git-Tag: glibc-2.17~591 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c44738353ecaa1c81efca063ee8b55e092d7a43;p=thirdparty%2Fglibc.git Don't change no_dyn_threshold on mallopt failure * malloc/malloc.c (__libc_mallopt) : Do not change internal state upon failure. --- diff --git a/ChangeLog b/ChangeLog index db63a81d0e7..6529e08f0f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-09-05 Alexandre Oliva + + * malloc/malloc.c (__libc_mallopt) : Do not + change internal state upon failure. + 2012-09-05 Alexandre Oliva * malloc/mcheck.c (mcheck_check_all): Fix typo. diff --git a/malloc/malloc.c b/malloc/malloc.c index bd562df9591..c69e2813897 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -4769,8 +4769,10 @@ int __libc_mallopt(int param_number, int value) if((unsigned long)value > HEAP_MAX_SIZE/2) res = 0; else - mp_.mmap_threshold = value; - mp_.no_dyn_threshold = 1; + { + mp_.mmap_threshold = value; + mp_.no_dyn_threshold = 1; + } break; case M_MMAP_MAX: