mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-12 16:20:06 +00:00
malloc: Fix MALLOC_DEBUG -Wundef warning
MALLOC_DEBUG is set optionally on the command line. Default the value to zero if it is not set on the command line, and test its value with #if rather than #ifdef. Verified the code is identical before and after this change apart from line numbers. ChangeLog: 2014-04-11 Will Newton <will.newton@linaro.org> * malloc/malloc.c [!MALLOC_DEBUG]: #define MALLOC_DEBUG to zero if it is not defined elsewhere. (mtrim): Test the value of MALLOC_DEBUG with #if rather than #ifdef.
This commit is contained in:
parent
6a5d6ea128
commit
439bda3209
@ -1,3 +1,9 @@
|
|||||||
|
2014-04-11 Will Newton <will.newton@linaro.org>
|
||||||
|
|
||||||
|
* malloc/malloc.c [!MALLOC_DEBUG]: #define MALLOC_DEBUG
|
||||||
|
to zero if it is not defined elsewhere. (mtrim): Test
|
||||||
|
the value of MALLOC_DEBUG with #if rather than #ifdef.
|
||||||
|
|
||||||
2014-04-10 Torvald Riegel <triegel@redhat.com>
|
2014-04-10 Torvald Riegel <triegel@redhat.com>
|
||||||
|
|
||||||
* benchtests/pthread_once-inputs: New file.
|
* benchtests/pthread_once-inputs: New file.
|
||||||
|
@ -270,6 +270,10 @@
|
|||||||
or other mallocs available that do this.
|
or other mallocs available that do this.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef MALLOC_DEBUG
|
||||||
|
#define MALLOC_DEBUG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
# define assert(expr) ((void) 0)
|
# define assert(expr) ((void) 0)
|
||||||
#else
|
#else
|
||||||
@ -4477,7 +4481,7 @@ mtrim (mstate av, size_t pad)
|
|||||||
|
|
||||||
if (size > psm1)
|
if (size > psm1)
|
||||||
{
|
{
|
||||||
#ifdef MALLOC_DEBUG
|
#if MALLOC_DEBUG
|
||||||
/* When debugging we simulate destroying the memory
|
/* When debugging we simulate destroying the memory
|
||||||
content. */
|
content. */
|
||||||
memset (paligned_mem, 0x89, size & ~psm1);
|
memset (paligned_mem, 0x89, size & ~psm1);
|
||||||
|
Loading…
Reference in New Issue
Block a user