nuttx/libs
Michal Lenc 1e1185c63e libs/libc/obstack/lib_obstack_free.c: fix object check within chunk
The original condition incorrectly used &h->chunk instead of
h->chunk in the calculation whether the object is in the chunk. This
could lead to the wrong behavior as the first branch gave incorrect
result and thus sometimes the entire obstack was freed even though
object was not NULL.

The commit also simplifies the logic, we can use pointer arithmetic
here and just do h->chunk + 1 as it gives the same result as
(FAR char *)h->chunk + sizeof(struct _obstack_chunk). This saves
unnecessary cast and sizeof.

The second branch should be less than or equal, not just less than.
This ensures the object is correctly located in the chunk even after
previous obstack_finish was called.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Karel Kočí <kkoci@elektroline.cz>
2025-12-23 10:28:25 +08:00
..
libbuiltin libs: remove not related comments from cmake files 2025-10-11 17:07:51 -04:00
libc libs/libc/obstack/lib_obstack_free.c: fix object check within chunk 2025-12-23 10:28:25 +08:00
libdsp style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
libm libm/newlib: Include fenv sources for all ARCHs and extend x86 includes 2025-11-30 20:43:58 +08:00
libnx style/FAR: remove FAR qualifier 2025-11-10 10:56:29 +01:00
libxx libs: remove not related comments from cmake files 2025-10-11 17:07:51 -04:00
CMakeLists.txt libs: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00