summaryrefslogtreecommitdiff
path: root/src/common/mempool.h
diff options
context:
space:
mode:
authorbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-05 02:53:33 +0000
committerbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-05 02:53:33 +0000
commit60a426c0742b3e7d8c5b557c7578df6eeeea377b (patch)
tree5d01f9ccc2798309f9b13f07c0096ed97c6a85c8 /src/common/mempool.h
parent621db2441f69736a6c8f10d26bf966d5414fac74 (diff)
downloadhercules-60a426c0742b3e7d8c5b557c7578df6eeeea377b.tar.gz
hercules-60a426c0742b3e7d8c5b557c7578df6eeeea377b.tar.bz2
hercules-60a426c0742b3e7d8c5b557c7578df6eeeea377b.tar.xz
hercules-60a426c0742b3e7d8c5b557c7578df6eeeea377b.zip
- Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).
[16969:16991/trunk/src/] will be re-committed in the next 24 hours. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16992 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/mempool.h')
-rw-r--r--src/common/mempool.h62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/common/mempool.h b/src/common/mempool.h
index 9c4f1563e..aeaebe7fe 100644
--- a/src/common/mempool.h
+++ b/src/common/mempool.h
@@ -8,67 +8,67 @@ typedef struct mempool *mempool;
typedef void (*memPoolOnNodeAllocationProc)(void *ptr);
typedef void (*memPoolOnNodeDeallocationProc)(void *ptr);
-typedef struct mempool_stats {
- int64 num_nodes_total;
- int64 num_nodes_free;
- int64 num_nodes_used;
-
- int64 num_segments;
- int64 num_realloc_events;
-
- int64 peak_nodes_used;
-
- int64 num_bytes_total;
+typedef struct mempool_stats{
+ int64 num_nodes_total;
+ int64 num_nodes_free;
+ int64 num_nodes_used;
+
+ int64 num_segments;
+ int64 num_realloc_events;
+
+ int64 peak_nodes_used;
+
+ int64 num_bytes_total;
} mempool_stats;
-//
+//
void mempool_init();
void mempool_final();
-/**
+/**
* Creates a new Mempool
*
* @param name - Name of the pool (used for debug / error messages)
* @param elem_size - size of each element
- * @param initial_count - preallocation count
+ * @param initial_count - preallocation count
* @param realloc_count - #no of nodes being allocated when pool is running empty.
* @param onNodeAlloc - Node Allocation callback (see @note!)
* @param onNodeDealloc - Node Deallocation callback (see @note!)
*
* @note:
- * The onNode(De)alloc callbacks are only called once during segment allocation
- * (pool initialization / rallocation )
+ * The onNode(De)alloc callbacks are only called once during segment allocation
+ * (pool initialization / rallocation )
* you can use this callbacks for example to initlaize a mutex or somethingelse
- * you definitly need during runtime
+ * you definitly need during runtime
*
* @return not NULL
*/
mempool mempool_create(const char *name,
- uint64 elem_size,
- uint64 initial_count,
- uint64 realloc_count,
-
- memPoolOnNodeAllocationProc onNodeAlloc,
- memPoolOnNodeDeallocationProc onNodeDealloc);
-
-
+ uint64 elem_size,
+ uint64 initial_count,
+ uint64 realloc_count,
+
+ memPoolOnNodeAllocationProc onNodeAlloc,
+ memPoolOnNodeDeallocationProc onNodeDealloc);
+
+
/**
* Destroys a Mempool
- *
+ *
* @param pool - the mempool to destroy
*
* @note:
- * Everything gets deallocated, regardless if everything was freed properly!
- * So you have to ensure that all references are cleared properly!
+ * Everything gets deallocated, regardless if everything was freed properly!
+ * So you have to ensure that all references are cleared properly!
*/
void mempool_destroy(mempool pool);
/**
* Gets a new / empty node from the given mempool.
- *
+ *
* @param pool - the pool to get an empty node from.
*
* @return Address of empty Node
@@ -80,12 +80,12 @@ void *mempool_node_get(mempool pool);
* Returns the given node to the given mempool
*
* @param pool - the pool to put the node, to
- * @param node - the node to return
+ * @param node - the node to return
*/
void mempool_node_put(mempool pool, void *node);
-/**
+/**
* Returns Statistics for the given mempool
*
* @param pool - the pool to get thats for