diff options
Diffstat (limited to 'src/gallium/auxiliary/util/u_memory.h')
-rw-r--r-- | src/gallium/auxiliary/util/u_memory.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/util/u_memory.h b/src/gallium/auxiliary/util/u_memory.h index 1a6b596421..0b18d043ad 100644 --- a/src/gallium/auxiliary/util/u_memory.h +++ b/src/gallium/auxiliary/util/u_memory.h @@ -36,7 +36,7 @@ #include "util/u_pointer.h" -#include "pipe/p_debug.h" +#include "util/u_debug.h" #ifdef __cplusplus @@ -52,11 +52,11 @@ extern "C" { #endif -#if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) && defined(DEBUG) +#if defined(PIPE_OS_WINDOWS) && defined(DEBUG) /* memory debugging */ -#include "pipe/p_debug.h" +#include "util/u_debug.h" #define MALLOC( _size ) \ debug_malloc( __FILE__, __LINE__, __FUNCTION__, _size ) @@ -191,9 +191,11 @@ align_free(void *ptr) #if defined(HAVE_POSIX_MEMALIGN) FREE(ptr); #else - void **cubbyHole = (void **) ((char *) ptr - sizeof(void *)); - void *realAddr = *cubbyHole; - FREE(realAddr); + if (ptr) { + void **cubbyHole = (void **) ((char *) ptr - sizeof(void *)); + void *realAddr = *cubbyHole; + FREE(realAddr); + } #endif /* defined(HAVE_POSIX_MEMALIGN) */ } |