diff options
author | Eric Andersen <andersen@codepoet.org> | 2004-01-16 13:43:30 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2004-01-16 13:43:30 +0000 |
commit | 338237994ac93ca58f6024ef0f7932ab770735d1 (patch) | |
tree | 4417f2f77bc3224e09979303a45e2cd76c5d14be /libc/stdlib | |
parent | 76374f68fbc07420cd459b0d0fae424895ea4141 (diff) |
s/UCLIBC_HAS_MMU/ARCH_HAS_MMU/g
Diffstat (limited to 'libc/stdlib')
-rw-r--r-- | libc/stdlib/malloc-simple/alloc.c | 8 | ||||
-rw-r--r-- | libc/stdlib/malloc/malloc.h | 2 |
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 |