mirror of
https://github.com/BinomialLLC/basis_universal.git
synced 2026-11-19 06:16:18 +00:00
Was always including malloc.h - this is now only done on Linux. It was for malloc_usable_size().
This commit is contained in:
@@ -5,7 +5,12 @@
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef __linux__
|
||||
// Only for malloc_usable_size() in basisu_containers_impl.h
|
||||
#include <malloc.h>
|
||||
#define HAS_MALLOC_USABLE_SIZE 1
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define BASISU_FORCE_INLINE __forceinline
|
||||
|
||||
@@ -57,10 +57,10 @@ namespace basisu
|
||||
|
||||
#ifdef _MSC_VER
|
||||
actual_size = _msize(new_p);
|
||||
//#elif defined(__EMSCRIPTEN__)
|
||||
// actual_size = desired_size;
|
||||
#else
|
||||
#elif HAS_MALLOC_USABLE_SIZE
|
||||
actual_size = malloc_usable_size(new_p);
|
||||
#else
|
||||
actual_size = desired_size;
|
||||
#endif
|
||||
m_p = new_p;
|
||||
}
|
||||
@@ -84,10 +84,10 @@ namespace basisu
|
||||
|
||||
#ifdef _MSC_VER
|
||||
actual_size = _msize(new_p);
|
||||
//#elif defined(__EMSCRIPTEN__)
|
||||
// actual_size = desired_size;
|
||||
#else
|
||||
#elif HAS_MALLOC_USABLE_SIZE
|
||||
actual_size = malloc_usable_size(new_p);
|
||||
#else
|
||||
actual_size = desired_size;
|
||||
#endif
|
||||
|
||||
(*pMover)(new_p, m_p, m_size);
|
||||
|
||||
Reference in New Issue
Block a user