svn commit: trunk/uClibc: extra/Configs libc/stdlib/malloc-standar etc...
vapier at uclibc.org
vapier at uclibc.org
Fri Aug 25 04:57:02 UTC 2006
Author: vapier
Date: 2006-08-24 21:57:01 -0700 (Thu, 24 Aug 2006)
New Revision: 15994
Log:
fix from psm: makes use of the malloc debug option in malloc-standard as well
Modified:
trunk/uClibc/extra/Configs/Config.in
trunk/uClibc/libc/stdlib/malloc-standard/Makefile.in
trunk/uClibc/libc/stdlib/malloc-standard/malloc.c
trunk/uClibc/libc/stdlib/malloc-standard/malloc.h
Changeset:
Modified: trunk/uClibc/extra/Configs/Config.in
===================================================================
--- trunk/uClibc/extra/Configs/Config.in 2006-08-25 04:54:39 UTC (rev 15993)
+++ trunk/uClibc/extra/Configs/Config.in 2006-08-25 04:57:01 UTC (rev 15994)
@@ -1496,7 +1496,7 @@
config UCLIBC_MALLOC_DEBUGGING
bool "Build malloc with debugging support"
- depends MALLOC
+ depends MALLOC || MALLOC_STANDARD
default n
help
Answer Y here to compile extra debugging support code into malloc.
Modified: trunk/uClibc/libc/stdlib/malloc-standard/Makefile.in
===================================================================
--- trunk/uClibc/libc/stdlib/malloc-standard/Makefile.in 2006-08-25 04:54:39 UTC (rev 15993)
+++ trunk/uClibc/libc/stdlib/malloc-standard/Makefile.in 2006-08-25 04:57:01 UTC (rev 15994)
@@ -5,11 +5,6 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-# Turn on malloc debugging if requested
-ifeq ($(UCLIBC_MALLOC_DEBUGGING),y)
-CFLAGS += -D__MALLOC_DEBUGGING
-endif
-
# calloc.c can be found at uClibc/libc/stdlib/calloc.c
# valloc.c can be found at uClibc/libc/stdlib/valloc.c
CSRC := malloc.c calloc.c realloc.c free.c memalign.c mallopt.c mallinfo.c
Modified: trunk/uClibc/libc/stdlib/malloc-standard/malloc.c
===================================================================
--- trunk/uClibc/libc/stdlib/malloc-standard/malloc.c 2006-08-25 04:54:39 UTC (rev 15993)
+++ trunk/uClibc/libc/stdlib/malloc-standard/malloc.c 2006-08-25 04:57:01 UTC (rev 15994)
@@ -33,7 +33,7 @@
/* forward declaration */
static int __malloc_largebin_index(unsigned int sz);
-#ifdef __MALLOC_DEBUGGING
+#ifdef __UCLIBC_MALLOC_DEBUGGING__
/*
Debugging support
@@ -43,21 +43,21 @@
programs. This can be very effective (albeit in an annoying way)
in helping track down dangling pointers.
- If you compile with -D__MALLOC_DEBUGGING, a number of assertion checks are
+ If you compile with __UCLIBC_MALLOC_DEBUGGING__, a number of assertion checks are
enabled that will catch more memory errors. You probably won't be
able to make much sense of the actual assertion errors, but they
should help you locate incorrectly overwritten memory. The
checking is fairly extensive, and will slow down execution
- noticeably. Calling malloc_stats or mallinfo with __MALLOC_DEBUGGING set will
+ noticeably. Calling malloc_stats or mallinfo with __UCLIBC_MALLOC_DEBUGGING__ set will
attempt to check every non-mmapped allocated and free chunk in the
course of computing the summmaries. (By nature, mmapped regions
cannot be checked very much automatically.)
- Setting __MALLOC_DEBUGGING may also be helpful if you are trying to modify
+ Setting __UCLIBC_MALLOC_DEBUGGING__ may also be helpful if you are trying to modify
this code. The assertions in the check routines spell out in more
detail the assumptions and invariants underlying the algorithms.
- Setting __MALLOC_DEBUGGING does NOT provide an automated mechanism for checking
+ Setting __UCLIBC_MALLOC_DEBUGGING__ does NOT provide an automated mechanism for checking
that all accesses to malloced memory stay within their
bounds. However, there are several add-ons and adaptations of this
or other mallocs available that do this.
Modified: trunk/uClibc/libc/stdlib/malloc-standard/malloc.h
===================================================================
--- trunk/uClibc/libc/stdlib/malloc-standard/malloc.h 2006-08-25 04:54:39 UTC (rev 15993)
+++ trunk/uClibc/libc/stdlib/malloc-standard/malloc.h 2006-08-25 04:57:01 UTC (rev 15994)
@@ -925,7 +925,7 @@
At most one "call" to get_malloc_state is made per invocation of
the public versions of malloc and free, but other routines
that in turn invoke malloc and/or free may call more then once.
- Also, it is called in check* routines if __MALLOC_DEBUGGING is set.
+ Also, it is called in check* routines if __UCLIBC_MALLOC_DEBUGGING__ is set.
*/
#define get_malloc_state() (&(__malloc_state))
@@ -935,7 +935,7 @@
/* Debugging support */
-#if ! __MALLOC_DEBUGGING
+#ifndef __UCLIBC_MALLOC_DEBUGGING__
#define check_chunk(P)
#define check_free_chunk(P)
More information about the uClibc-cvs
mailing list