diff audacious/memorypool.c @ 2290:9fc150e3542e trunk

[svn] - add memory_pool_add(): adds a pre-allocated element to a memory pool
author nenolod
date Sun, 07 Jan 2007 00:47:47 -0800
parents 4446a9e7bdee
children 10e07bc9a8c9
line wrap: on
line diff
--- a/audacious/memorypool.c	Sat Jan 06 13:29:29 2007 -0800
+++ b/audacious/memorypool.c	Sun Jan 07 00:47:47 2007 -0800
@@ -54,6 +54,16 @@
 }
 
 gpointer
+memory_pool_add(MemoryPool * pool, gpointer ptr)
+{
+    g_mutex_lock(pool->mutex);
+    pool->stack = g_list_append(pool->stack, addr);
+    g_mutex_unlock(pool->mutex);
+
+    return ptr;
+}
+
+gpointer
 memory_pool_allocate(MemoryPool * pool, gsize sz)
 {
     gpointer addr;