mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
mesa: Use _aligned_malloc/free for MinGW too.
We already use these for gallium in src/gallium/auxiliary/os/os_memory_stdc.h and it's always better to minimize divergences between MinGW and MSVC. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
c69ef377c8
commit
950da38164
1 changed files with 4 additions and 4 deletions
|
|
@ -89,7 +89,7 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment)
|
|||
if (err)
|
||||
return NULL;
|
||||
return mem;
|
||||
#elif defined(_WIN32) && defined(_MSC_VER)
|
||||
#elif defined(_WIN32)
|
||||
return _aligned_malloc(bytes, alignment);
|
||||
#else
|
||||
uintptr_t ptr, buf;
|
||||
|
|
@ -131,7 +131,7 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment)
|
|||
}
|
||||
|
||||
return mem;
|
||||
#elif defined(_WIN32) && defined(_MSC_VER)
|
||||
#elif defined(_WIN32)
|
||||
void *mem;
|
||||
|
||||
mem = _aligned_malloc(bytes, alignment);
|
||||
|
|
@ -178,7 +178,7 @@ _mesa_align_free(void *ptr)
|
|||
{
|
||||
#if defined(HAVE_POSIX_MEMALIGN)
|
||||
free(ptr);
|
||||
#elif defined(_WIN32) && defined(_MSC_VER)
|
||||
#elif defined(_WIN32)
|
||||
_aligned_free(ptr);
|
||||
#else
|
||||
if (ptr) {
|
||||
|
|
@ -196,7 +196,7 @@ void *
|
|||
_mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize,
|
||||
unsigned long alignment)
|
||||
{
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
#if defined(_WIN32)
|
||||
(void) oldSize;
|
||||
return _aligned_realloc(oldBuffer, newSize, alignment);
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue