mirror of
https://github.com/mjansson/rpmalloc.git
synced 2026-01-15 19:41:17 +01:00
Clang compat
This commit is contained in:
@@ -131,12 +131,12 @@ extern inline void* RPMALLOC_CDECL pvalloc(size_t size) { return rppvalloc(size)
|
||||
extern inline void* RPMALLOC_CDECL reallocarray(void* ptr, size_t count, size_t size) { return rpreallocarray(ptr, count, size); }
|
||||
|
||||
#ifdef _WIN32
|
||||
extern inline RPMALLOC_RESTRICT void* RPMALLOC_CDECL _malloc_base(size_t size) { return rpmalloc(size); }
|
||||
extern inline void* RPMALLOC_CDECL _malloc_base(size_t size) { return rpmalloc(size); }
|
||||
extern inline void RPMALLOC_CDECL _free_base(void* ptr) { rpfree(ptr); }
|
||||
extern inline RPMALLOC_RESTRICT void* RPMALLOC_CDECL _calloc_base(size_t count, size_t size) { return rpcalloc(count, size); }
|
||||
extern inline void* RPMALLOC_CDECL _calloc_base(size_t count, size_t size) { return rpcalloc(count, size); }
|
||||
extern inline size_t RPMALLOC_CDECL _msize(void* ptr) { return rpmalloc_usable_size(ptr); }
|
||||
extern inline size_t RPMALLOC_CDECL _msize_base(void* ptr) { return rpmalloc_usable_size(ptr); }
|
||||
extern inline RPMALLOC_RESTRICT void* RPMALLOC_CDECL _realloc_base(void* ptr, size_t size) { return rprealloc(ptr, size); }
|
||||
extern inline void* RPMALLOC_CDECL _realloc_base(void* ptr, size_t size) { return rprealloc(ptr, size); }
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -264,13 +264,13 @@ static rpmalloc_statistics_t global_statistics;
|
||||
static inline size_t
|
||||
rpmalloc_clz(uintptr_t x) {
|
||||
#if ARCH_64BIT
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
return (size_t)_lzcnt_u64(x);
|
||||
#else
|
||||
return (size_t)__builtin_clzll(x);
|
||||
#endif
|
||||
#else
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
return (size_t)_lzcnt_u32(x);
|
||||
#else
|
||||
return (size_t)__builtin_clzl(x);
|
||||
|
||||
Reference in New Issue
Block a user