[Mesa-dev] [PATCH 6/7] tgsi: add a tgsi_free_tokens() function

Brian Paul brianp at vmware.com
Thu Oct 30 20:04:14 PDT 2014


To match tgsi_alloc_tokens().
---
 src/gallium/auxiliary/tgsi/tgsi_parse.c |   10 ++++++++++
 src/gallium/auxiliary/tgsi/tgsi_parse.h |    3 +++
 2 files changed, 13 insertions(+)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.c b/src/gallium/auxiliary/tgsi/tgsi_parse.c
index 5bf8f48..f2370ed 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_parse.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_parse.c
@@ -291,6 +291,16 @@ tgsi_alloc_tokens(unsigned num_tokens)
 }
 
 
+/**
+ * Free tokens allocated by tgsi_alloc_tokens() or tgsi_dup_tokens()
+ */
+void
+tgsi_free_tokens(const struct tgsi_token *tokens)
+{
+   FREE((void *) tokens);
+}
+
+
 void
 tgsi_dump_tokens(const struct tgsi_token *tokens)
 {
diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.h b/src/gallium/auxiliary/tgsi/tgsi_parse.h
index 2e450a4..bfcca48 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_parse.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_parse.h
@@ -150,6 +150,9 @@ tgsi_dup_tokens(const struct tgsi_token *tokens);
 struct tgsi_token *
 tgsi_alloc_tokens(unsigned num_tokens);
 
+void
+tgsi_free_tokens(const struct tgsi_token *tokens);
+
 
 #if defined __cplusplus
 }
-- 
1.7.10.4



More information about the mesa-dev mailing list