summaryrefslogtreecommitdiff
path: root/lib/skin_parser/skin_parser.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-06-17 13:54:09 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-06-17 13:54:09 +0000
commit95b0cefad012c3092d8e0f4c91118fe157baf6c0 (patch)
tree3657fac796b197f165af21ac1f60bac35ccb01f2 /lib/skin_parser/skin_parser.c
parent8d3dbb88094a8774cd571675d76a1319850259c5 (diff)
tiny clean up of memory allocation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26887 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'lib/skin_parser/skin_parser.c')
-rw-r--r--lib/skin_parser/skin_parser.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c
index f7ff4ad693..9c360231e1 100644
--- a/lib/skin_parser/skin_parser.c
+++ b/lib/skin_parser/skin_parser.c
@@ -51,6 +51,8 @@ static int skin_parse_conditional(struct skin_element* element,
static int skin_parse_comment(struct skin_element* element, char** document);
static struct skin_element* skin_parse_code_as_arg(char** document);
+
+
struct skin_element* skin_parse(const char* document)
{
@@ -836,15 +838,10 @@ static struct skin_element* skin_parse_code_as_arg(char** document)
/* Memory management */
-char* skin_alloc(size_t size)
-{
- return skin_buffer_alloc(size);
-}
-
struct skin_element* skin_alloc_element()
{
struct skin_element* retval = (struct skin_element*)
- skin_alloc(sizeof(struct skin_element));
+ skin_buffer_alloc(sizeof(struct skin_element));
retval->type = UNKNOWN;
retval->next = NULL;
retval->tag = NULL;
@@ -858,19 +855,19 @@ struct skin_element* skin_alloc_element()
struct skin_tag_parameter* skin_alloc_params(int count)
{
size_t size = sizeof(struct skin_tag_parameter) * count;
- return (struct skin_tag_parameter*)skin_alloc(size);
+ return (struct skin_tag_parameter*)skin_buffer_alloc(size);
}
char* skin_alloc_string(int length)
{
- return (char*)skin_alloc(sizeof(char) * (length + 1));
+ return (char*)skin_buffer_alloc(sizeof(char) * (length + 1));
}
struct skin_element** skin_alloc_children(int count)
{
return (struct skin_element**)
- skin_alloc(sizeof(struct skin_element*) * count);
+ skin_buffer_alloc(sizeof(struct skin_element*) * count);
}
void skin_free_tree(struct skin_element* root)