Introduce object pool allocator
The object pool allocator provides a simplistic interface to manage
allocation in a fixed-size static array. The caller creates a static
"object pool" out of such an array and may then call pool_alloc() to
get the next available object within the pool. There is also a variant
to get multiple consecutive objects: pool_alloc_n().

Note that this interface does not provide any way to free the objects
afterwards. This is by design and it is not a limitation. We do not
want to introduce complexity induced by memory freeing, such as
use-after-free bugs, memory fragmentation and so on.

Change-Id: Iefc2e153767851fbde5841a295f92ae48adda71f
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
1 parent f7a1826 commit 9cc4651c9d7098e8ef659e067e501f436f488988
@Sandrine Bailleux Sandrine Bailleux authored on 1 Jun 2018
Showing 1 changed file
View
include/lib/object_pool.h 0 → 100644