configure with --enable-malloc-debugging fails to compile

Jim Kleckner jek-cygwin2@kleckner.net
Thu Feb 14 03:28:00 GMT 2008


Christopher Faylor wrote:
> On Wed, Feb 13, 2008 at 12:16:44PM -0800, Jim Kleckner wrote:
>   
>> FYI, the --enable-malloc-debugging option fails to compile with current
>> CVS sources.
>>
>> (/oss/src/configure --prefix=/oss/mdebug.install --enable-debugging 
>> --enable-malloc-debugging -v; make) >& make.out
>>     
>
> And your proposal for fixing this is...?
>
> cgf
>   
Well, I'm a total noob but here goes.

It looks to me like debug.h is defining those functions earlier (see below).
I suspect that MALLOC_DEBUG is overkill for most things though.

I suppose this really should go to cygwin-patches?

I just read the list prior to posting this and see lots of messages.
I see there is quite a bit of established protocol.  Be patient, please.

Thanks - Jim

* cygmalloc.h: Protected malloc function definitions with #ifndef 
MALLOC_DEBUG because
debug.h defines them earlier when debugging.

Index: cygwin/cygmalloc.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/cygmalloc.h,v
retrieving revision 1.12
diff -u -u -p -r1.12 cygmalloc.h
--- cygwin/cygmalloc.h    8 Feb 2007 11:35:52 -0000    1.12
+++ cygwin/cygmalloc.h    14 Feb 2008 03:18:08 -0000
@@ -11,6 +11,7 @@ details. */
 #ifdef __cplusplus
 extern "C" {
 #endif
+#ifndef MALLOC_DEBUG
 void dlfree (void *p) __attribute__ ((regparm (1)));
 void *dlmalloc (unsigned size) __attribute__ ((regparm (1)));
 void *dlrealloc (void *p, unsigned size) __attribute__ ((regparm (2)));
@@ -21,6 +22,7 @@ size_t dlmalloc_usable_size (void *p) __
 int dlmalloc_trim (size_t) __attribute__ ((regparm (1)));
 int dlmallopt (int p, int v) __attribute__ ((regparm (2)));
 void dlmalloc_stats ();
+#endif /* MALLOC_DEBUG */
 
 #ifndef __INSIDE_CYGWIN__
 extern "C" void __set_ENOMEM ();



More information about the Cygwin-developers mailing list