zephyr/lib/os
Nicolas Pitre 132b2b8c99 mempool: trap on double-free instances
A double-free could cause very hard to find bugs when using the mempool
allocator as the same memory would end up being allocated twice
afterwards.

Now that bits in the block bitmap are cleared only when actually freeing
a block, we may simply ensure those bits are still set before clearing
them, effectively catching most double-free cases.

The alloc_bit_is_set() function is made static inline so that when
assertion checks are disabled the compiler won't complain about unused
code.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-11-06 21:42:42 +01:00
..
assert.c assert: generate oops if invoked from usermode 2019-07-20 08:29:39 -04:00
base64.c cleanup: include/: move base64.h to sys/base64.h 2019-06-27 22:55:49 -04:00
CMakeLists.txt Bluetooth: Host: Remove printk dependency from settings 2019-09-25 17:36:39 +02:00
crc7_sw.c cleanup: include/: move crc.h to sys/crc.h 2019-06-27 22:55:49 -04:00
crc8_sw.c cleanup: include/: move crc.h to sys/crc.h 2019-06-27 22:55:49 -04:00
crc16_sw.c cleanup: include/: move crc.h to sys/crc.h 2019-06-27 22:55:49 -04:00
crc32_sw.c cleanup: include/: move crc.h to sys/crc.h 2019-06-27 22:55:49 -04:00
dec.c tests: move util test to be unit tests 2019-09-27 15:23:26 -04:00
fdtable.c cleanup: include/: move misc/speculation.h to sys/speculation.h 2019-06-27 22:55:49 -04:00
hex.c kernel: lib: Add convert functions for hex strings and binary arrays 2019-07-16 12:44:18 +02:00
json.c cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
Kconfig kconfig: Clean up header comments and make them consistent 2019-11-04 17:31:27 -05:00
mempool.c mempool: trap on double-free instances 2019-11-06 21:42:42 +01:00
mutex.c kernel: syscalls: Whitespace fixups 2019-09-12 11:31:50 +08:00
printk.c userspace: Support for split 64 bit arguments 2019-09-12 11:31:50 +08:00
rb.c cleanup: include/: move misc/rb.h to sys/rb.h 2019-06-27 22:55:49 -04:00
ring_buffer.c cleanup: include/: move ring_buffer.h to sys/ring_buffer.h 2019-06-27 22:55:49 -04:00
sem.c lib: os: add sys_sem data type 2019-07-24 10:12:25 -07:00
thread_entry.c lib: os: remove dead code 2019-06-18 09:08:01 -04:00
timeutil.c lib/timeutil: avoid implementation-defined behavior 2019-09-19 20:49:51 -04:00
work_q.c lib: flatten all loose components into one lib 2019-01-22 07:45:22 -05:00