fix(util/memory): memory allocation problem when using clang++ 3.5 on Ubuntu 14.04
This commit is contained in:
parent
4c6b0dc0e5
commit
1c55e2f389
1 changed files with 6 additions and 6 deletions
|
@ -68,8 +68,8 @@ void free(void * ptr) {
|
|||
namespace lean {
|
||||
inline size_t malloc_size(void * ptr) { return malloc_usable_size(ptr); }
|
||||
inline void * malloc_core(size_t sz) { return ::malloc(sz); }
|
||||
inline void * realloc_core(void * ptr, size_t sz) { return realloc(ptr, sz); }
|
||||
inline void free_core(void * ptr) { free(ptr); }
|
||||
inline void * realloc_core(void * ptr, size_t sz) { return ::realloc(ptr, sz); }
|
||||
inline void free_core(void * ptr) { ::free(ptr); }
|
||||
}
|
||||
// REMARK: We commented the following piece of code because tc_malloc_size is hanging
|
||||
|
||||
|
@ -86,16 +86,16 @@ inline void free_core(void * ptr) { free(ptr); }
|
|||
namespace lean {
|
||||
inline size_t malloc_size(void * ptr) { return ::malloc_size(ptr); }
|
||||
inline void * malloc_core(size_t sz) { return ::malloc(sz); }
|
||||
inline void * realloc_core(void * ptr, size_t sz) { return realloc(ptr, sz); }
|
||||
inline void free_core(void * ptr) { free(ptr); }
|
||||
inline void * realloc_core(void * ptr, size_t sz) { return ::realloc(ptr, sz); }
|
||||
inline void free_core(void * ptr) { ::free(ptr); }
|
||||
}
|
||||
#elif defined(HAS_MSIZE)
|
||||
#include <malloc.h> // NOLINT
|
||||
namespace lean {
|
||||
inline size_t malloc_size(void * ptr) { return _msize(ptr); }
|
||||
inline void * malloc_core(size_t sz) { return ::malloc(sz); }
|
||||
inline void * realloc_core(void * ptr, size_t sz) { return realloc(ptr, sz); }
|
||||
inline void free_core(void * ptr) { free(ptr); }
|
||||
inline void * realloc_core(void * ptr, size_t sz) { return ::realloc(ptr, sz); }
|
||||
inline void free_core(void * ptr) { ::free(ptr); }
|
||||
}
|
||||
#else
|
||||
namespace lean {
|
||||
|
|
Loading…
Reference in a new issue