Przeglądaj źródła

__malloc_consolidate is only libc internal, enable use of __sbrk

Peter S. Mazinger 20 lat temu
rodzic
commit
68ab26b26b

+ 1 - 1
libc/stdlib/malloc-standard/free.c

@@ -169,7 +169,7 @@ static void malloc_init_state(mstate av)
   malloc anyway, it turns out to be the perfect place to trigger
   malloc anyway, it turns out to be the perfect place to trigger
   initialization code.
   initialization code.
 */
 */
-void __malloc_consolidate(mstate av)
+void attribute_hidden __malloc_consolidate(mstate av)
 {
 {
     mfastbinptr*    fb;                 /* current fastbin being consolidated */
     mfastbinptr*    fb;                 /* current fastbin being consolidated */
     mfastbinptr*    maxfb;              /* last fastbin (for loop control) */
     mfastbinptr*    maxfb;              /* last fastbin (for loop control) */

+ 2 - 1
libc/stdlib/malloc-standard/malloc.h

@@ -16,6 +16,7 @@
 
 
 #define mmap __mmap
 #define mmap __mmap
 #define sysconf __sysconf
 #define sysconf __sysconf
+#define sbrk __sbrk
 
 
 #include <features.h>
 #include <features.h>
 #include <stddef.h>
 #include <stddef.h>
@@ -929,7 +930,7 @@ extern struct malloc_state __malloc_state;  /* never directly referenced */
 #define get_malloc_state() (&(__malloc_state))
 #define get_malloc_state() (&(__malloc_state))
 
 
 /* External internal utilities operating on mstates */
 /* External internal utilities operating on mstates */
-void   __malloc_consolidate(mstate);
+void   __malloc_consolidate(mstate) attribute_hidden;
 
 
 
 
 /* Debugging support */
 /* Debugging support */

+ 1 - 0
libc/stdlib/malloc/free.c

@@ -12,6 +12,7 @@
  */
  */
 
 
 #define munmap __munmap
 #define munmap __munmap
+#define sbrk __sbrk
 
 
 #include <stdlib.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <unistd.h>

+ 1 - 0
libc/stdlib/malloc/malloc.c

@@ -12,6 +12,7 @@
  */
  */
 
 
 #define mmap __mmap
 #define mmap __mmap
+#define sbrk __sbrk
 
 
 #include <stdlib.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <unistd.h>