]> mj.ucw.cz Git - libucw.git/commit
Introduced generic allocators
authorMartin Mares <mj@ucw.cz>
Tue, 28 Jan 2014 20:50:04 +0000 (21:50 +0100)
committerMartin Mares <mj@ucw.cz>
Tue, 28 Jan 2014 20:50:04 +0000 (21:50 +0100)
commita1fd264e82dc24343c8129a3e8e611f976f262c9
tree06d834e8c3d29a5eccf3e6e83b3adc30a3db99ab
parentb2e520371195bba5827fa19c824a5e2636a9e211
Introduced generic allocators

The concept of generic allocators, previously used locally in gary's,
turned out to be very promising and applicable to other data structures
in the future.

So I decided to decouple allocators from gary.[ch] and introduce them
to the society of libucw primitives.

<ucw/alloc.h> now provides allocators for malloc and zeroed malloc,
each mempool can also serve as an allocator (the current implementation
has an instance of struct ucw_allocator in each struct mempool, but
it is always accessed through an inline function, so it can be changed
if the overhead is deemed too heavy).

Growing arrays have been redefined in terms of generic allocators.

The realloc module has been merged to alloc.c to keep our malloc
wrappers together.
12 files changed:
ucw/Makefile
ucw/alloc-std.c [new file with mode: 0644]
ucw/alloc.c
ucw/alloc.h [new file with mode: 0644]
ucw/conf-intr.c
ucw/gary-mp.c [deleted file]
ucw/gary.c
ucw/gary.h
ucw/gary.t
ucw/mempool.c
ucw/mempool.h
ucw/realloc.c [deleted file]