QuickIO  0.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
pool.h
Go to the documentation of this file.
1 
15 #include "qev.h"
16 
20 typedef struct qev_pool qev_pool_t;
21 
25 typedef void* (*qev_pool_new_fn)();
26 
47  const qev_pool_new_fn new_fn,
48  const qev_free_fn reset_fn,
49  const qev_free_fn free_fn,
50  const guint local_size,
51  const guint global_size,
52  const gboolean preallocate);
53 
57 void qev_pool_free(qev_pool_t *pool);
58 
67 
77 void* qev_pool_get(qev_pool_t *pool);
78 
87 void qev_pool_put(qev_pool_t *pool, void *obj);
void qev_pool_register_thread()
Pools need to know about all threads that will access them before they are created.
qev_pool_t * qev_pool_new(const qev_pool_new_fn new_fn, const qev_free_fn reset_fn, const qev_free_fn free_fn, const guint local_size, const guint global_size, const gboolean preallocate)
Creates a pool of objects.
struct qev_pool qev_pool_t
You're not allowed to touch anything in the pool.
Definition: pool.h:20
void qev_pool_put(qev_pool_t *pool, void *obj)
Puts an object back into the pool.
void qev_pool_free(qev_pool_t *pool)
Closes down and cleans out all objects left in the pool.
void *(* qev_pool_new_fn)()
Function that creates a new instance of the managed object.
Definition: pool.h:25
Provides all the qev_* functions that are needed for creating an event loop.
void(* qev_free_fn)(void *)
Function type for a typical free function.
Definition: qev.h:185
void * qev_pool_get(qev_pool_t *pool)
Gets an object from the pool.