Go to the source code of this file.
- Parameters
-
pool | pool to initialize |
atom_size | size of atom in bytes |
Initializes a pool by setting size of atoms and maximal size of the pool. Initially the pool has no any allocated atoms. Aom will be allocated during the first request to take an atom.
Definition at line 79 of file pools.c.
91 printf(
"<POOL> Create pool %d (size=%d)\n",
92 pool->
id, atom_size );
- Parameters
-
pool | pool from which to allocate atom |
- Returns
- new atom from the pool
Takes atom from the pool. First attempts to take it from the list. If empty it takes from the block. If it is empty too then expands the pool with a new fresh block and takes atom from it.
Definition at line 203 of file pools.c.
223 printf(
"<ATOM> +[%08x]\n",(
int)
new );
226 #ifdef DEBUG_RUNTIME_ATOMS
230 dump_atom_address( (
atom_t)
new );
234 #ifdef DEBUG_COMPILETIME_ATOMS
238 dump_atom_address( (
atom_t)
new );
- Parameters
-
pool | pool that will accept the atom |
a | atom to be returned |
Returns atom to the pool. The function assumes that the atom size is the same as the pool's atom size. Returned atoms are attached to the list and never to the block.
Definition at line 148 of file pools.c.
152 printf(
"<ATOM> -[%08x]\n",(
int)a);
155 #ifdef DEBUG_RUNTIME_ATOMS
159 dump_atom_address( a );
164 #ifdef DEBUG_COMPILETIME_ATOMS
168 dump_atom_address( a );
174 #ifdef DEBUG_CLEAR_FREED_MEM
176 #endif //DEBUG_CLEAR_FREE_MEM