aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldso/dynlink.c2
-rw-r--r--src/internal/malloc_impl.h4
-rw-r--r--src/malloc/expand_heap.c3
-rw-r--r--src/malloc/lite_malloc.c3
-rw-r--r--src/malloc/malloc.c2
5 files changed, 7 insertions, 7 deletions
diff --git a/ldso/dynlink.c b/ldso/dynlink.c
index b561454..1d3dacc 100644
--- a/ldso/dynlink.c
+++ b/ldso/dynlink.c
@@ -20,6 +20,7 @@
#include "pthread_impl.h"
#include "libc.h"
#include "dynlink.h"
+#include "malloc_impl.h"
static void error(const char *, ...);
@@ -500,7 +501,6 @@ static void redo_lazy_relocs()
static void reclaim(struct dso *dso, size_t start, size_t end)
{
- void __malloc_donate(char *, char *);
if (start >= dso->relro_start && start < dso->relro_end) start = dso->relro_end;
if (end >= dso->relro_start && end < dso->relro_end) end = dso->relro_start;
if (start >= end) return;
diff --git a/src/internal/malloc_impl.h b/src/internal/malloc_impl.h
index 4355d84..40d1696 100644
--- a/src/internal/malloc_impl.h
+++ b/src/internal/malloc_impl.h
@@ -8,6 +8,10 @@ int __munmap(void *, size_t);
void *__mremap(void *, size_t, size_t, int, ...);
int __madvise(void *, size_t, int);
+void *__expand_heap(size_t *);
+
+void __malloc_donate(char *, char *);
+
struct chunk {
size_t psize, csize;
struct chunk *next, *prev;
diff --git a/src/malloc/expand_heap.c b/src/malloc/expand_heap.c
index d8c0be7..e6a3d7a 100644
--- a/src/malloc/expand_heap.c
+++ b/src/malloc/expand_heap.c
@@ -4,6 +4,7 @@
#include <sys/mman.h>
#include "libc.h"
#include "syscall.h"
+#include "malloc_impl.h"
/* This function returns true if the interval [old,new]
* intersects the 'len'-sized interval below &libc.auxv
@@ -27,8 +28,6 @@ static int traverses_stack_p(uintptr_t old, uintptr_t new)
return 0;
}
-void *__mmap(void *, size_t, int, int, int, off_t);
-
/* Expand the heap in-place if brk can be used, or otherwise via mmap,
* using an exponential lower bound on growth by mmap to make
* fragmentation asymptotically irrelevant. The size argument is both
diff --git a/src/malloc/lite_malloc.c b/src/malloc/lite_malloc.c
index 96c4fea..49157d3 100644
--- a/src/malloc/lite_malloc.c
+++ b/src/malloc/lite_malloc.c
@@ -3,11 +3,10 @@
#include <limits.h>
#include <errno.h>
#include "libc.h"
+#include "malloc_impl.h"
#define ALIGN 16
-void *__expand_heap(size_t *);
-
static void *__simple_malloc(size_t n)
{
static char *cur, *end;
diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
index d72883e..9698259 100644
--- a/src/malloc/malloc.c
+++ b/src/malloc/malloc.c
@@ -123,8 +123,6 @@ void __dump_heap(int x)
}
#endif
-void *__expand_heap(size_t *);
-
static struct chunk *expand_heap(size_t n)
{
static int heap_lock[2];