summaryrefslogtreecommitdiffstats
path: root/llvm/runtime/GCCLibraries/libc/memory.c
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2003-12-15 22:32:50 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2003-12-15 22:32:50 +0000
commit97f451555dfceff98d242305f1b12a915e2b8ea9 (patch)
tree8044162e95e9849f84204802155526dac23e4409 /llvm/runtime/GCCLibraries/libc/memory.c
parent6c08bb8b8eb67f621308fdd20e05784c7edc05df (diff)
downloadbcm5719-llvm-97f451555dfceff98d242305f1b12a915e2b8ea9.tar.gz
bcm5719-llvm-97f451555dfceff98d242305f1b12a915e2b8ea9.zip
Make all memory functions have weak linkage so that they can be overridden with
custom memory-management implementations (e.g., bash). llvm-svn: 10478
Diffstat (limited to 'llvm/runtime/GCCLibraries/libc/memory.c')
-rw-r--r--llvm/runtime/GCCLibraries/libc/memory.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/runtime/GCCLibraries/libc/memory.c b/llvm/runtime/GCCLibraries/libc/memory.c
index 560c6dae1da..a839832d1ce 100644
--- a/llvm/runtime/GCCLibraries/libc/memory.c
+++ b/llvm/runtime/GCCLibraries/libc/memory.c
@@ -6,9 +6,10 @@
#include <stdlib.h>
-void *malloc(size_t);
-void free(void *);
-void *memset(void *, int, size_t);
+void *malloc(size_t) __attribute__((weak));
+void free(void *) __attribute__((weak));
+void *memset(void *, int, size_t) __attribute__((weak));
+void *calloc(size_t nelem, size_t elsize) __attribute__((weak));
void *calloc(size_t nelem, size_t elsize) {
void *Result = malloc(nelem*elsize);
OpenPOWER on IntegriCloud