![]() |
![]() |
![]() |
Evolution-Data-Server Manual: Utilities (libedataserver) | ![]() |
---|---|---|---|---|
Top | Description |
EMemChunk; EMemChunk * e_memchunk_new (gint atomcount
,gint atomsize
); gpointer e_memchunk_alloc (EMemChunk *m
); gpointer e_memchunk_alloc0 (EMemChunk *m
); void e_memchunk_free (EMemChunk *m
,gpointer mem
); void e_memchunk_empty (EMemChunk *m
); void e_memchunk_clean (EMemChunk *m
); void e_memchunk_destroy (EMemChunk *m
);
EMemChunk * e_memchunk_new (gint atomcount
,gint atomsize
);
Create a new memchunk 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.
|
The number of atoms stored in a single malloc'd block of memory. |
|
The size of each allocation. |
Returns : |
The new header. |
void e_memchunk_free (EMemChunk *m
,gpointer mem
);
Free a single atom back to the free pool of atoms in the given memchunk.
|
Address of atom to free. |
void e_memchunk_empty (EMemChunk *m
);
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.
void e_memchunk_clean (EMemChunk *m
);
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).
void e_memchunk_destroy (EMemChunk *m
);
Free the memchunk header, and all associated memory.