|
| 1 | +#define HAVE_MMAP 0 |
| 2 | +#define MMAP_CLEARS 0 |
| 3 | +#define HAVE_MORECORE 1 |
| 4 | +#define MORECORE_CONTIGUOUS 0 |
| 5 | +#define NO_MALLOC_STATS 1 |
| 6 | +#define malloc_getpagesize ((size_t)8192U) |
| 7 | +#define LACKS_TIME_H /* time(0) calls malloc... */ |
| 8 | + |
1 | 9 | /*
|
2 | 10 | This is a version (aka dlmalloc) of malloc/free/realloc written by
|
3 | 11 | Doug Lea and released to the public domain, as explained at
|
@@ -813,14 +821,14 @@ extern "C" {
|
813 | 821 | /* ------------------- Declarations of public routines ------------------- */
|
814 | 822 |
|
815 | 823 | #ifndef USE_DL_PREFIX
|
816 |
| -#define dlcalloc calloc |
817 |
| -#define dlfree free |
818 |
| -#define dlmalloc malloc |
819 |
| -#define dlmemalign memalign |
820 |
| -#define dlposix_memalign posix_memalign |
821 |
| -#define dlrealloc realloc |
| 824 | +#define dlcalloc __calloc |
| 825 | +#define dlfree __free |
| 826 | +#define dlmalloc __malloc |
| 827 | +#define dlmemalign __memalign |
| 828 | +#define dlposix_memalign __posix_memalign |
| 829 | +#define dlrealloc __realloc |
822 | 830 | #define dlrealloc_in_place realloc_in_place
|
823 |
| -#define dlvalloc valloc |
| 831 | +#define dlvalloc __valloc |
824 | 832 | #define dlpvalloc pvalloc
|
825 | 833 | #define dlmallinfo mallinfo
|
826 | 834 | #define dlmallopt mallopt
|
@@ -996,7 +1004,7 @@ DLMALLOC_EXPORT size_t dlmalloc_max_footprint(void);
|
996 | 1004 | guarantee that this number of bytes can actually be obtained from
|
997 | 1005 | the system.
|
998 | 1006 | */
|
999 |
| -DLMALLOC_EXPORT size_t dlmalloc_footprint_limit(); |
| 1007 | +DLMALLOC_EXPORT size_t dlmalloc_footprint_limit(void); |
1000 | 1008 |
|
1001 | 1009 | /*
|
1002 | 1010 | malloc_set_footprint_limit();
|
@@ -4151,7 +4159,8 @@ static void* sys_alloc(mstate m, size_t nb) {
|
4151 | 4159 | char* end = CMFAIL;
|
4152 | 4160 | ACQUIRE_MALLOC_GLOBAL_LOCK();
|
4153 | 4161 | br = (char*)(CALL_MORECORE(asize));
|
4154 |
| - end = (char*)(CALL_MORECORE(0)); |
| 4162 | + /* end = (char*)(CALL_MORECORE(0)); */ |
| 4163 | + end = br + asize; |
4155 | 4164 | RELEASE_MALLOC_GLOBAL_LOCK();
|
4156 | 4165 | if (br != CMFAIL && end != CMFAIL && br < end) {
|
4157 | 4166 | size_t ssize = end - br;
|
@@ -6278,3 +6287,11 @@ int mspace_mallopt(int param_number, int value) {
|
6278 | 6287 | structure of old version, but most details differ.)
|
6279 | 6288 |
|
6280 | 6289 | */
|
| 6290 | + |
| 6291 | +weak_alias (__calloc, calloc) |
| 6292 | +weak_alias(__free, free) |
| 6293 | +weak_alias(__malloc, malloc) |
| 6294 | +weak_alias (__memalign, memalign) |
| 6295 | +weak_alias(__posix_memalign, posix_memalign) |
| 6296 | +weak_alias (__realloc, realloc) |
| 6297 | +weak_alias (__valloc, valloc) |
0 commit comments