From cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8 Mon Sep 17 00:00:00 2001 From: "\"Steven J. Hill\"" Date: Sat, 25 Feb 2006 04:03:33 +0000 Subject: Merge from trunk. Going pretty good so far. Kind of. Okay, not really. --- libc/stdlib/malloc-simple/alloc.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'libc/stdlib/malloc-simple/alloc.c') diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c index 5a208bf28..e382cee55 100644 --- a/libc/stdlib/malloc-simple/alloc.c +++ b/libc/stdlib/malloc-simple/alloc.c @@ -1,15 +1,13 @@ /* alloc.c * - * Written by Erik Andersen - * LGPLv2 + * Copyright (C) 2000-2006 Erik Andersen * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ +/* * Parts of the memalign code were stolen from malloc-930716. */ -#define mmap __mmap -#define munmap __munmap - -#define _GNU_SOURCE #include #include #include @@ -19,6 +17,10 @@ #include #include +libc_hidden_proto(memcpy) +/*libc_hidden_proto(memset)*/ +libc_hidden_proto(mmap) +libc_hidden_proto(munmap) #ifdef L_malloc void *malloc(size_t size) @@ -34,7 +36,7 @@ void *malloc(size_t size) #endif } -#ifdef __ARCH_HAS_MMU__ +#ifdef __ARCH_USE_MMU__ # define MMAP_FLAGS MAP_PRIVATE | MAP_ANONYMOUS #else # define MMAP_FLAGS MAP_SHARED | MAP_ANONYMOUS @@ -67,7 +69,7 @@ void * calloc(size_t nmemb, size_t lsize) * doesn't need to actually zero anything.... */ if (result != NULL) { - __memset(result, 0, size); + memset(result, 0, size); } #endif return result; @@ -88,7 +90,7 @@ void *realloc(void *ptr, size_t size) newptr = malloc(size); if (newptr) { - __memcpy(newptr, ptr, *((size_t *) (ptr - sizeof(size_t)))); + memcpy(newptr, ptr, *((size_t *) (ptr - sizeof(size_t)))); free(ptr); } return newptr; -- cgit v1.2.3