From: martin-s Date: Thu, 18 Aug 2011 21:01:07 +0000 (+0000) Subject: Fix:Core:Avoid name clash with some libpthread X-Git-Tag: navit-0.5.0.5194svn~508 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00e8ac4121531c74a96777bd8789ca6fef4747ad;p=profile%2Fivi%2Fnavit.git Fix:Core:Avoid name clash with some libpthread git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4687 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/navit/debug.c b/navit/navit/debug.c index 779276a..2f87f3d 100644 --- a/navit/navit/debug.c +++ b/navit/navit/debug.c @@ -287,7 +287,7 @@ struct malloc_tail { int magic; }; -int mallocs,malloc_size,malloc_size_m; +int mallocs,debug_malloc_size,debug_malloc_size_m; void debug_dump_mallocs(void) @@ -314,10 +314,10 @@ debug_malloc(const char *where, int line, const char *func, int size) if (!size) return NULL; mallocs++; - malloc_size+=size; - if (malloc_size/(1024*1024) != malloc_size_m) { - malloc_size_m=malloc_size/(1024*1024); - dbg(0,"malloced %d kb\n",malloc_size/1024); + debug_malloc_size+=size; + if (debug_malloc_size/(1024*1024) != debug_malloc_size_m) { + debug_malloc_size_m=debug_malloc_size/(1024*1024); + dbg(0,"malloced %d kb\n",debug_malloc_size/1024); } head=malloc(size+sizeof(*head)+sizeof(*tail)); head->magic=0xdeadbeef; @@ -397,7 +397,7 @@ debug_free(const char *where, int line, const char *func, void *ptr) mallocs--; head=(struct malloc_head *)((unsigned char *)ptr-sizeof(*head)); tail=(struct malloc_tail *)((unsigned char *)ptr+head->size); - malloc_size-=head->size; + debug_malloc_size-=head->size; if (head->magic != 0xdeadbeef || tail->magic != 0xdeadbef0) { fprintf(stderr,"Invalid free from %s:%d %s\n",where,line,func); }