Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mem_slab: rationalize block alignment assertion
The block alignment must be enforced for statically allocated slabs as well as runtime initialized ones. It is best to implement this check only once in create_free_list() which is invoked by both k_mem_slab_init() and init_mem_slab_module(), where pointers are about to be set for the first time. It is then unnecessary to perform this test on every slab allocation as the alignment won't change at that point. And not only the block size needs to be aligned, but the buffer as well. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
- Loading branch information