2313
|
1 /* Audacious
|
|
2 * Copyright (c) 2007 William Pitcock <nenolod -at- atheme.org>
|
|
3 *
|
|
4 * This program is free software; you can redistribute it and/or modify
|
|
5 * it under the terms of the GNU General Public License as published by
|
|
6 * the Free Software Foundation; under version 2 of the License.
|
|
7 *
|
|
8 * This program is distributed in the hope that it will be useful,
|
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11 * GNU General Public License for more details.
|
|
12 *
|
|
13 * You should have received a copy of the GNU General Public License
|
|
14 * along with this program; if not, write to the Free Software
|
|
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
16 */
|
|
17
|
|
18 #ifndef AUDACIOUS_MEMORYPOOL_H
|
|
19 #define AUDACIOUS_MEMORYPOOL_H
|
|
20
|
|
21 typedef struct _MemoryPool MemoryPool;
|
|
22
|
|
23 MemoryPool * memory_pool_new(void);
|
|
24 MemoryPool * memory_pool_with_custom_destructor(GDestroyNotify notify);
|
|
25
|
|
26 gpointer memory_pool_add(MemoryPool * pool, gpointer ptr);
|
|
27 gpointer memory_pool_allocate(MemoryPool * pool, gsize sz);
|
|
28 void memory_pool_release(MemoryPool * pool, gpointer addr);
|
|
29
|
|
30 void memory_pool_cleanup(MemoryPool * pool);
|
|
31
|
|
32 void memory_pool_destroy(MemoryPool * pool);
|
|
33
|
|
34 gchar * memory_pool_strdup(MemoryPool * pool, gchar * src);
|
|
35
|
|
36 #define memory_pool_alloc_object(pool, obj) \
|
|
37 memory_pool_allocate(pool, sizeof(obj))
|
|
38
|
|
39 #endif
|