diff options
Diffstat (limited to 'src/mesa/pipe/p_util.h')
-rw-r--r-- | src/mesa/pipe/p_util.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mesa/pipe/p_util.h b/src/mesa/pipe/p_util.h index 059528787d..469920efee 100644 --- a/src/mesa/pipe/p_util.h +++ b/src/mesa/pipe/p_util.h @@ -29,6 +29,7 @@ #define P_UTIL_H #include "p_compiler.h" +#include "p_debug.h" #include <math.h> @@ -183,6 +184,20 @@ align_free(void *ptr) +/** + * Duplicate of a block of memory + */ +static INLINE void * +mem_dup(const void *src, uint size) +{ + void *dup = malloc(size); + if (dup) + memcpy(dup, src, size); + return dup; +} + + + #define CLAMP( X, MIN, MAX ) ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) ) #define MIN2( A, B ) ( (A)<(B) ? (A) : (B) ) #define MAX2( A, B ) ( (A)>(B) ? (A) : (B) ) @@ -381,10 +396,6 @@ static INLINE int align(int value, int alignment) return (value + alignment - 1) & ~(alignment - 1); } -/* Convenient... - */ -extern void _mesa_printf(const char *str, ...); - /* util/p_util.c */ |