@@ -1739,8 +1739,18 @@ remove them if not needed.
1739
1739
#include < mutex> // for std::mutex
1740
1740
#include < atomic> // for std::atomic
1741
1741
1742
- #if !defined(_WIN32)
1742
+ #if !defined(_WIN32) && !defined(__APPLE__)
1743
1743
#include < malloc.h> // for aligned_alloc()
1744
+ #endif
1745
+
1746
+ #if defined(__APPLE__)
1747
+ #include < cstdlib>
1748
+ void *aligned_alloc (size_t alignment, size_t size)
1749
+ {
1750
+ void *pointer;
1751
+ posix_memalign (&pointer, alignment, size);
1752
+ return pointer;
1753
+ }
1744
1754
#endif
1745
1755
1746
1756
// Normal assert to check for programmer's errors, especially in Debug configuration.
@@ -4964,7 +4974,7 @@ void VmaBlockMetadata::PrintDetailedMap(class VmaJsonWriter& json) const
4964
4974
json.WriteNumber (m_SumFreeSize);
4965
4975
4966
4976
json.WriteString (" Allocations" );
4967
- json.WriteNumber (m_Suballocations.size () - m_FreeCount);
4977
+ json.WriteNumber (( uint64_t ) m_Suballocations.size () - m_FreeCount);
4968
4978
4969
4979
json.WriteString (" UnusedRanges" );
4970
4980
json.WriteNumber (m_FreeCount);
@@ -6322,7 +6332,7 @@ size_t VmaBlockVector::CalcMaxBlockSize() const
6322
6332
size_t result = 0 ;
6323
6333
for (size_t i = m_Blocks.size (); i--; )
6324
6334
{
6325
- result = VMA_MAX (result, m_Blocks[i]->m_Metadata .GetSize ());
6335
+ result = VMA_MAX (( uint64_t ) result, ( uint64_t ) m_Blocks[i]->m_Metadata .GetSize ());
6326
6336
if (result >= m_PreferredBlockSize)
6327
6337
{
6328
6338
break ;
@@ -6408,15 +6418,15 @@ void VmaBlockVector::PrintDetailedMap(class VmaJsonWriter& json)
6408
6418
if (m_MinBlockCount > 0 )
6409
6419
{
6410
6420
json.WriteString (" Min" );
6411
- json.WriteNumber (m_MinBlockCount);
6421
+ json.WriteNumber (( uint64_t ) m_MinBlockCount);
6412
6422
}
6413
6423
if (m_MaxBlockCount < SIZE_MAX)
6414
6424
{
6415
6425
json.WriteString (" Max" );
6416
- json.WriteNumber (m_MaxBlockCount);
6426
+ json.WriteNumber (( uint64_t ) m_MaxBlockCount);
6417
6427
}
6418
6428
json.WriteString (" Cur" );
6419
- json.WriteNumber (m_Blocks.size ());
6429
+ json.WriteNumber (( uint64_t ) m_Blocks.size ());
6420
6430
json.EndObject ();
6421
6431
6422
6432
if (m_FrameInUseCount > 0 )
0 commit comments