summaryrefslogtreecommitdiffstats
path: root/libc/stdlib/malloc-simple/alloc.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
commitcb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8 (patch)
tree520f8e8d113184cfa7954ebd274564b8c255fa9a /libc/stdlib/malloc-simple/alloc.c
parente4461be66e2655058aef358b00050bc70ac72861 (diff)
downloaduClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.bz2
uClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.xz
Merge from trunk. Going pretty good so far. Kind of. Okay, not really.
Diffstat (limited to 'libc/stdlib/malloc-simple/alloc.c')
-rw-r--r--libc/stdlib/malloc-simple/alloc.c20
1 files changed, 11 insertions, 9 deletions
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 <andersee@codepoet.org>
- * LGPLv2
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
+ * 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 <features.h>
#include <unistd.h>
#include <stdio.h>
@@ -19,6 +17,10 @@
#include <errno.h>
#include <sys/mman.h>
+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;