-
Committer:
chtsanti
-
Date:
2012-02-06 11:01:03 UTC
-
Revision ID:
svn-v4:a5cfe682-fa50-0410-8a04-e816b4a88288:c-icap-server/trunk:835
Mem allocators changes indended to eliminate the calls to malloc
Mem allocators changes:
- Fix the _CI_ALIGN macro to use better alignment.
- The type of the ci_mem_allocator_t object now stored inside ci_mem_allocator
struct
- Define an object pool for ci_mem_allocator_t objects and use this pool
to allocate ci_mem_allocator_t objects if possible.
- Define an object pool for pack_allocator struct
- pool_allocator does not allow any more the user to define a ci_mem_allocator
object to be used for allocating/deallocating objects. Internally uses
always malloc/free.
- The serial_allocator_t allocate the required space using the ci_buffers_*
subsystem. Also the required internal serial_allocator_t, ci_mem_allocator_t
and other structures allocated on this allocated space, to eliminate calls
to malloc.
- Other minor changes
- Investigate the following new functions for pack allocators:
- ci_create_pack_allocator_on_memblock
This function allocate the pack_allocator_t and ci_mem_allocator_t
required structures on the buffer given by the user.
- ci_pack_allocator_alloc_from_rear
Allocate the requested memory at the end of the buffer
- ci_pack_allocator_set_start_pos
Sets the start of the available memory on buffer on the given possitio
n
- ci_pack_allocator_set_end_pos
Sets the end of the available memory on buffer on the given possition
- ci_pack_allocator_required_size
- ci_pack_allocator_alloc_unaligned