tgsi: added tgsi_alloc_tokens()

This commit is contained in:
Brian Paul
2010-02-02 21:23:23 -07:00
parent c173eb990a
commit 439036739d
2 changed files with 15 additions and 0 deletions
+11
View File
@@ -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);
}
+4
View File
@@ -130,6 +130,10 @@ tgsi_num_tokens(const struct tgsi_token *tokens);
struct tgsi_token *
tgsi_dup_tokens(const struct tgsi_token *tokens);
struct tgsi_token *
tgsi_alloc_tokens(unsigned num_tokens);
#if defined __cplusplus
}
#endif