diff --git a/external/3rd/library/platform/utils/Base/BlockAllocator.h b/external/3rd/library/platform/utils/Base/BlockAllocator.h index 5daf69da..bbfbf273 100644 --- a/external/3rd/library/platform/utils/Base/BlockAllocator.h +++ b/external/3rd/library/platform/utils/Base/BlockAllocator.h @@ -20,7 +20,7 @@ namespace Base void returnBlock(unsigned *handle); private: - unsigned *m_blocks[31]; + uintptr_t *m_blocks[31]; }; }; #ifdef EXTERNAL_DISTRO diff --git a/external/3rd/library/platform/utils/Base/win32/BlockAllocator.cpp b/external/3rd/library/platform/utils/Base/win32/BlockAllocator.cpp index 9fa8b645..029946b4 100644 --- a/external/3rd/library/platform/utils/Base/win32/BlockAllocator.cpp +++ b/external/3rd/library/platform/utils/Base/win32/BlockAllocator.cpp @@ -23,8 +23,8 @@ namespace Base { while(m_blocks[i] != NULL) { - unsigned *tmp = m_blocks[i]; - m_blocks[i] = (unsigned *)*m_blocks[i]; + uintptr_t *tmp = m_blocks[i]; + m_blocks[i] = (uintptr_t *)*m_blocks[i]; free(tmp); } } @@ -36,7 +36,7 @@ namespace Base void *BlockAllocator::getBlock(unsigned bytes) { unsigned accum = 16, bits = 16; - unsigned *handle = NULL; + uintptr_t *handle = NULL; // Perform a binary search looking for the highest bit. @@ -79,7 +79,7 @@ namespace Base if(m_blocks[accum] == 0) { // remove the pre allocated block from the linked list - handle = (unsigned *)calloc(((1 << accum) / 4) + 2, sizeof(unsigned)); + handle = (uintptr_t *)calloc(((1 << accum) / 4) + 2, sizeof(unsigned)); handle[1] = accum; handle[0] = 0; } @@ -87,7 +87,7 @@ namespace Base { // Allocate a new block handle = m_blocks[accum]; - m_blocks[accum] = (unsigned *)handle[0]; + m_blocks[accum] = (uintptr_t *)handle[0]; handle[0] = 0; } // return a pointer that skips over the header used for the allocator's purposes @@ -100,7 +100,7 @@ namespace Base if(handle) { // Update the allocator linked list, insert this entry at the head - *(handle - 2) = (unsigned)m_blocks[*(handle - 1)]; + *(handle - 2) = (uintptr_t)m_blocks[*(handle - 1)]; // Add this entry to the proper linked list node m_blocks[*(handle - 1)] = (handle - 2); }