Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mm_grantable.c: Fix infinite loop due to memory fragmentation #323

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions mm/mm_gran/mm_grantable.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,21 +232,7 @@ bool gran_match(const gran_t *gran, size_t posi, size_t size, bool used,
{
/* Handle full GAT quickly */

tmp = 32;
}
else if (c == r.sidx)
{
/* offset of first unused when matching for free */

v = ~v;
#ifdef CONFIG_HAVE_BUILTIN_CTZ
tmp = __builtin_ctz(v);
#else
tmp = (uint32_t)((lsb_mask(v)) * DEBRUJIN_NUM) >> 27;
DEBUGASSERT(tmp < sizeof(DEBRUJIN_LUT));
tmp = DEBRUJIN_LUT[tmp];
#endif
tmp = tmp - 1; /* Ok, because v >= 1 */
tmp = 31;
}
else
{
Expand Down
Loading