projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
64ca067
)
gallium: added mem_dup()
author
Brian
<brian.paul@tungstengraphics.com>
Wed, 6 Feb 2008 16:28:20 +0000
(09:28 -0700)
committer
Ben Skeggs
<skeggsb@gmail.com>
Fri, 15 Feb 2008 02:50:32 +0000
(13:50 +1100)
src/mesa/pipe/p_util.h
patch
|
blob
|
history
diff --git
a/src/mesa/pipe/p_util.h
b/src/mesa/pipe/p_util.h
index 4780ed7818446372fcfa8e930cd8b801198eaeae..991ac447bacd9a8b49c6be8d4c714fdc175ce04b 100644
(file)
--- a/
src/mesa/pipe/p_util.h
+++ b/
src/mesa/pipe/p_util.h
@@
-183,6
+183,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) )