Was always including malloc.h - this is now only done on Linux. It was for malloc_usable_size().

This commit is contained in:
Rich Geldreich
2021-03-10 03:22:15 -05:00
parent 0b137c169b
commit 2f2965992b
2 changed files with 11 additions and 6 deletions
+5
View File
@@ -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
+6 -6
View File
@@ -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);