summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_parse.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-02-02 21:23:23 -0700
committerBrian Paul <[email protected]>2010-02-02 21:23:23 -0700
commit439036739db2855bba5f0ffc12b7b727897cb530 (patch)
tree0f6fc7a5e6cb4a6a226f83222ce90dd0e6b42c57 /src/gallium/auxiliary/tgsi/tgsi_parse.c
parentc173eb990a20611ac47c1727e1fb11d7fd3aa0c4 (diff)
tgsi: added tgsi_alloc_tokens()
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_parse.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_parse.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.c b/src/gallium/auxiliary/tgsi/tgsi_parse.c
index fd37fc3079b..7e19e1fe36f 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_parse.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_parse.c
@@ -284,3 +284,14 @@ tgsi_dup_tokens(const struct tgsi_token *tokens)
memcpy(new_tokens, tokens, bytes);
return new_tokens;
}
+
+
+/**
+ * Allocate memory for num_tokens tokens.
+ */
+struct tgsi_token *
+tgsi_alloc_tokens(unsigned num_tokens)
+{
+ unsigned bytes = num_tokens * sizeof(struct tgsi_token);
+ return (struct tgsi_token *) MALLOC(bytes);
+}