forked from len0rd/rockbox
More concrete names for the head and the tail of the linked list (no functional changes)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28501 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c044117c5f
commit
de56a2284a
1 changed files with 10 additions and 9 deletions
|
@ -66,11 +66,12 @@ struct malloc_object {
|
||||||
void* object;
|
void* object;
|
||||||
struct malloc_object *next;
|
struct malloc_object *next;
|
||||||
};
|
};
|
||||||
static struct malloc_object *first = NULL, *last = NULL;
|
static struct malloc_object *malloced_head = NULL, *malloced_tail = NULL;
|
||||||
|
|
||||||
static void skin_free_malloced(void)
|
static void skin_free_malloced(void)
|
||||||
{
|
{
|
||||||
struct malloc_object *obj = first, *this;
|
struct malloc_object *obj = malloced_head;
|
||||||
|
struct malloc_object *this;
|
||||||
while (obj)
|
while (obj)
|
||||||
{
|
{
|
||||||
this = obj;
|
this = obj;
|
||||||
|
@ -78,8 +79,8 @@ static void skin_free_malloced(void)
|
||||||
free(this->object);
|
free(this->object);
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
first = NULL;
|
malloced_head = NULL;
|
||||||
last = NULL;
|
malloced_tail = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -112,11 +113,11 @@ void* skin_buffer_alloc(size_t size)
|
||||||
return NULL;
|
return NULL;
|
||||||
obj->object = malloc(size);
|
obj->object = malloc(size);
|
||||||
obj->next = NULL;
|
obj->next = NULL;
|
||||||
if (last == NULL)
|
if (malloced_tail == NULL)
|
||||||
first = last = obj;
|
malloced_head = malloced_tail = obj;
|
||||||
else
|
else
|
||||||
last->next = obj;
|
malloced_tail->next = obj;
|
||||||
last = obj;
|
malloced_tail = obj;
|
||||||
retval = obj->object;
|
retval = obj->object;
|
||||||
#else
|
#else
|
||||||
retval = malloc(size);
|
retval = malloc(size);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue