diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2003-12-15 22:32:50 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2003-12-15 22:32:50 +0000 |
commit | a5df0cdbe2e23ccfe4f1875b4f28a68d25b66b81 (patch) | |
tree | f2e951a58db76145de80e55c4cf034e46315a60e /runtime/GCCLibraries | |
parent | 9e45d2e0e8d750ccca58fac3782ab9f821176cf8 (diff) |
Make all memory functions have weak linkage so that they can be overridden with
custom memory-management implementations (e.g., bash).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/GCCLibraries')
-rw-r--r-- | runtime/GCCLibraries/libc/memory.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/GCCLibraries/libc/memory.c b/runtime/GCCLibraries/libc/memory.c index 560c6dae1da..a839832d1ce 100644 --- a/runtime/GCCLibraries/libc/memory.c +++ b/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); |