nuttx-mirror/mm/mm_gran
Ville Juven fed3da9f03 mm_grantable.c: Fix infinite loop due to memory fragmentation
The search algorithm does not work with the ctz approach at all, if there
is a free range of granules that does not fit a specific allocation (i.e.
the granule allocation is fragmented) it will cause an infinite loop as
the algorithm will try to find free space from the same (free) starting
granule, causing an infinite loop.

The clz approach works for all cases, it will find the last used granule
and the search will continue from the next free granule.

Also, offsetting a full GAT must be sizeof(gat[0] - 1), which is 31 in
this case. The reason is that the upper level search function increments
the value by +1.
2024-12-05 20:36:04 +08:00
..
CMakeLists.txt mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00
Make.defs mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00
mm_gran.h mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00
mm_granalloc.c mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00
mm_grancritical.c mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00
mm_granfree.c mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00
mm_graninfo.c mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00
mm_graninit.c mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00
mm_granrelease.c mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00
mm_granreserve.c mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00
mm_grantable.c mm_grantable.c: Fix infinite loop due to memory fragmentation 2024-12-05 20:36:04 +08:00
mm_grantable.h mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00
mm_pgalloc.c mm: migrate to SPDX identifier 2024-09-13 08:49:05 +08:00