Searched hist:"9 cc4651c9d7098e8ef659e067e501f436f488988" (Results 1 – 1 of 1) sorted by relevance
| /rk3399_ARM-atf/include/lib/ |
| H A D | object_pool.h | 9cc4651c9d7098e8ef659e067e501f436f488988 Fri Jun 01 12:17:08 UTC 2018 Sandrine Bailleux <sandrine.bailleux@arm.com> 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>
|