diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-08-18 21:01:07 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-08-18 21:01:07 +0000 |
commit | 668e634d8bda6c344a82516defe16941c1494c90 (patch) | |
tree | 4c37041f4dda375e552e93033c6223893235ae6d /navit/debug.c | |
parent | 761db5ff18f3b206ef436a244b013a64c9963b8d (diff) | |
download | navit-668e634d8bda6c344a82516defe16941c1494c90.tar.gz |
Fix:Core:Avoid name clash with some libpthread
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4687 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/debug.c')
-rw-r--r-- | navit/debug.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/navit/debug.c b/navit/debug.c index 779276ab3..2f87f3ddd 100644 --- a/navit/debug.c +++ b/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); } |