Please sign in to comment.
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 <email@example.com>
- Loading branch information...