# HG changeset patch # User nenolod # Date 1168159667 28800 # Node ID 9fc150e3542edebf5f270f08e2d456e1300bf13b # Parent dcac9f84176d761b7a3fc070c863fcf9ec62f798 [svn] - add memory_pool_add(): adds a pre-allocated element to a memory pool diff -r dcac9f84176d -r 9fc150e3542e ChangeLog --- a/ChangeLog Sat Jan 06 13:29:29 2007 -0800 +++ b/ChangeLog Sun Jan 07 00:47:47 2007 -0800 @@ -1,3 +1,10 @@ +2007-01-06 21:29:29 +0000 Giacomo Lozito + revision [3586] + - strenghtened penalty check in playback_initiate to handle some extreme situations (such as no output plugins loaded) + trunk/audacious/playback.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + + 2007-01-06 20:33:11 +0000 Giacomo Lozito revision [3584] - fix uninitialized integer, that was bringing troubles if the last playlist item was not available for playback diff -r dcac9f84176d -r 9fc150e3542e audacious/memorypool.c --- 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; diff -r dcac9f84176d -r 9fc150e3542e audacious/memorypool.h --- a/audacious/memorypool.h Sat Jan 06 13:29:29 2007 -0800 +++ b/audacious/memorypool.h Sun Jan 07 00:47:47 2007 -0800 @@ -23,6 +23,7 @@ MemoryPool * memory_pool_new(void); MemoryPool * memory_pool_with_custom_destructor(GDestroyNotify notify); +gpointer memory_pool_add(MemoryPool * pool, gpointer ptr); gpointer memory_pool_allocate(MemoryPool * pool, gsize sz); void memory_pool_release(MemoryPool * pool, gpointer addr);