summaryrefslogtreecommitdiff
path: root/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib')
-rw-r--r--libc/stdlib/malloc-simple/alloc.c8
-rw-r--r--libc/stdlib/malloc/malloc.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c
index 4c6edd1f9..c0f702676 100644
--- a/libc/stdlib/malloc-simple/alloc.c
+++ b/libc/stdlib/malloc-simple/alloc.c
@@ -31,7 +31,7 @@ void *malloc(size_t size)
#endif
}
-#ifdef __UCLIBC_HAS_MMU__
+#ifdef __ARCH_HAS_MMU__
result = mmap((void *) 0, size + sizeof(size_t), PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (result == MAP_FAILED)
@@ -88,7 +88,7 @@ void *realloc(void *ptr, size_t size)
newptr = malloc(size);
if (newptr) {
memcpy(newptr, ptr,
-#ifdef __UCLIBC_HAS_MMU__
+#ifdef __ARCH_HAS_MMU__
*((size_t *) (ptr - sizeof(size_t)))
#else
size
@@ -111,7 +111,7 @@ void free(void *ptr)
return;
}
}
-#ifdef __UCLIBC_HAS_MMU__
+#ifdef __ARCH_HAS_MMU__
ptr -= sizeof(size_t);
munmap(ptr, * (size_t *) ptr + sizeof(size_t));
#else
@@ -154,7 +154,7 @@ int __libc_free_aligned(void *ptr)
/* Mark the block as free */
l->aligned = NULL;
ptr = l->exact;
-#ifdef __UCLIBC_HAS_MMU__
+#ifdef __ARCH_HAS_MMU__
ptr -= sizeof(size_t);
munmap(ptr, * (size_t *) ptr + sizeof(size_t));
#else
diff --git a/libc/stdlib/malloc/malloc.h b/libc/stdlib/malloc/malloc.h
index e5010d49b..37afe7299 100644
--- a/libc/stdlib/malloc/malloc.h
+++ b/libc/stdlib/malloc/malloc.h
@@ -43,7 +43,7 @@
heap, instead of mmap/munmap. This is a tradeoff -- sbrk is faster than
mmap/munmap, and guarantees contiguous allocation, but is also less
flexible, and causes the heap to only be shrinkable from the end. */
-#ifdef __UCLIBC_HAS_MMU__
+#ifdef __ARCH_HAS_MMU__
# define MALLOC_USE_SBRK
#endif