I believe this is the correct fix. I am guessing that the arch options I had selected when test compiling this patch did not actually compile this section of the code. If that fixes all the compilation errors you have, it seems valid to me.

Thanks

--

Chase Douglas
IBM Linux Technology Center
[EMAIL PROTECTED]
(614) 456-0455 T/L 268-7011

[EMAIL PROTECTED] wrote: -----

To: [email protected]
From: "Kieran Bingham" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
Date: 10/15/2008 07:11AM
Subject: __malloc_mmb_heap

Hi Guys,

With fresh download from RC2 I've hit a compile error:

  CC libc/stdlib/malloc/malloc.o
libc/stdlib/malloc/malloc.c:47: error: conflicting types for '__malloc_mmb_heap'
libc/stdlib/malloc/malloc.h:80: error: previous declaration of '__malloc_mmb_heap' was here

so to fix the conflict, I've changed malloc.h to match malloc.c :


diff --git a/libc/stdlib/malloc/malloc.h b/libc/stdlib/malloc/malloc.h
index f49ed34..657a67c 100644
--- a/libc/stdlib/malloc/malloc.h
+++ b/libc/stdlib/malloc/malloc.h
@@ -77,7 +77,7 @@ extern struct malloc_mmb *__malloc_mmapped_blocks;
 /* A heap used for allocating malloc_mmb structures.  We could allocate
    them from the main heap, but that tends to cause heap fragmentation in
    annoying ways.  */
-extern struct heap __malloc_mmb_heap;
+extern struct heap_free_area *__malloc_mmb_heap;

 /* Define MALLOC_MMB_DEBUGGING to cause malloc to emit debugging info about
    about mmap block allocation/freeing by the `uclinux broken munmap' code

But this then causes:
  CC libc/stdlib/malloc/free.o
libc/stdlib/malloc/free.c: In function 'free_to_heap':
libc/stdlib/malloc/free.c:178: warning: passing argument 2 of 'free_to_heap' from incompatible pointer type
  CC libc/stdlib/malloc/realloc.o

which I can fix with :

diff --git a/libc/stdlib/malloc/free.c b/libc/stdlib/malloc/free.c
index fd29690..44b2f89 100644
--- a/libc/stdlib/malloc/free.c
+++ b/libc/stdlib/malloc/free.c
@@ -175,7 +175,7 @@ free_to_heap (void *mem, struct heap_free_area *heap, malloc_mutex_t *heap_lock)
               __pthread_mutex_unlock (heap_lock);

              /* Release the descriptor block we used.  */
-             free_to_heap (mmb, &__malloc_mmb_heap, &__malloc_mmb_heap_lock);
+             free_to_heap (mmb, __malloc_mmb_heap, &__malloc_mmb_heap_lock);

              /* Do the actual munmap.  */
              munmap ((void *)mmb_start, mmb_end - mmb_start);


But I haven't looked into why this has changed type or anything like that - Is this the right thing to do ? and if so - well there it is :)
--
Cheers
Kieran Bingham

_______________________________________________
uClibc mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

_______________________________________________
uClibc mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Reply via email to