Skip to content

Commit 92b66e4

Browse files
committed
posix: semaphores: use a default minimal heap-add for semaphores
The implementation of POSIX_SEMAPHORES historically used heap allocation and has not yet been transitioned to a pool allocator. However, since 590258b, the default heap-add with CONFIG_POSIX_API has been reduced from 1 kiB which causes tests/posix/semaphores to fail due to NULL being returned from a call to k_calloc(). Create a minimal heap-add for the POSIX_SEMAPHORES Option Group. This can be removed at a future date if semaphores are changed to use a pooled allocator and fixed-size name, rather than heap allocation. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
1 parent e41909a commit 92b66e4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/posix/options/Kconfig.semaphore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ config POSIX_SEM_NAMELEN_MAX
3333
Maximum length of name for a named semaphore.
3434
The max value of 255 corresponds to {NAME_MAX}.
3535

36+
config HEAP_MEM_POOL_ADD_SIZE_POSIX_SEMAPHORES
37+
def_int 256
38+
3639
endif # POSIX_SEMAPHORES

0 commit comments

Comments
 (0)