Fix:Core:Avoid name clash with some libpthread
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 18 Aug 2011 21:01:07 +0000 (21:01 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 18 Aug 2011 21:01:07 +0000 (21:01 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4687 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/debug.c

index 779276a..2f87f3d 100644 (file)
@@ -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);
        }