Top |
Functions
EMemChunk * | e_memchunk_new () |
gpointer | e_memchunk_alloc () |
gpointer | e_memchunk_alloc0 () |
void | e_memchunk_free () |
void | e_memchunk_empty () |
void | e_memchunk_clean () |
void | e_memchunk_destroy () |
Functions
e_memchunk_new ()
EMemChunk * e_memchunk_new (gint atomcount
,gint atomsize
);
Create a new EMemChunk header. Memchunks are an efficient way to allocate and deallocate identical sized blocks of memory quickly, and space efficiently.
e_memchunks are effectively the same as gmemchunks, only faster (much), and they use less memory overhead for housekeeping.
e_memchunk_alloc ()
gpointer
e_memchunk_alloc (EMemChunk *memchunk
);
Allocate a new atom size block of memory from an EMemChunk.
Free the returned atom with e_memchunk_free()
.
e_memchunk_alloc0 ()
gpointer
e_memchunk_alloc0 (EMemChunk *memchunk
);
Allocate a new atom size block of memory from an EMemChunk,
and fill the memory with zeros. Free the returned atom with
e_memchunk_free()
.
e_memchunk_free ()
void e_memchunk_free (EMemChunk *memchunk
,gpointer mem
);
Free a single atom back to the free pool of atoms in the given memchunk.
e_memchunk_empty ()
void
e_memchunk_empty (EMemChunk *memchunk
);
Clean out the memchunk buffers. Marks all allocated memory as free blocks, but does not give it back to the system. Can be used if the memchunk is to be used repeatedly.
e_memchunk_clean ()
void
e_memchunk_clean (EMemChunk *memchunk
);
Scan all empty blocks and check for blocks which can be free'd back to the system.
This routine may take a while to run if there are many allocated memory blocks (if the total number of allocations is many times greater than atomcount).