mirror of
https://github.com/espressif/tlsf.git
synced 2025-11-16 12:34:46 +00:00
Update tlsf.c
Unsigned fix from Chris McEvoy @ Velan Studios.
This commit is contained in:
12
tlsf.c
12
tlsf.c
@@ -590,12 +590,12 @@ static void remove_free_block(control_t* control, block_header_t* block, int fl,
|
||||
/* If the new head is null, clear the bitmap. */
|
||||
if (next == &control->block_null)
|
||||
{
|
||||
control->sl_bitmap[fl] &= ~(1 << sl);
|
||||
control->sl_bitmap[fl] &= ~(1U << sl);
|
||||
|
||||
/* If the second bitmap is now empty, clear the fl bitmap. */
|
||||
if (!control->sl_bitmap[fl])
|
||||
{
|
||||
control->fl_bitmap &= ~(1 << fl);
|
||||
control->fl_bitmap &= ~(1U << fl);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -618,8 +618,8 @@ static void insert_free_block(control_t* control, block_header_t* block, int fl,
|
||||
** and second-level bitmaps appropriately.
|
||||
*/
|
||||
control->blocks[fl][sl] = block;
|
||||
control->fl_bitmap |= (1 << fl);
|
||||
control->sl_bitmap[fl] |= (1 << sl);
|
||||
control->fl_bitmap |= (1U << fl);
|
||||
control->sl_bitmap[fl] |= (1U << sl);
|
||||
}
|
||||
|
||||
/* Remove a given block from the free list. */
|
||||
@@ -853,9 +853,9 @@ int tlsf_check(tlsf_t tlsf)
|
||||
{
|
||||
for (j = 0; j < SL_INDEX_COUNT; ++j)
|
||||
{
|
||||
const int fl_map = control->fl_bitmap & (1 << i);
|
||||
const int fl_map = control->fl_bitmap & (1U << i);
|
||||
const int sl_list = control->sl_bitmap[i];
|
||||
const int sl_map = sl_list & (1 << j);
|
||||
const int sl_map = sl_list & (1U << j);
|
||||
const block_header_t* block = control->blocks[i][j];
|
||||
|
||||
/* Check that first- and second-level lists agree. */
|
||||
|
||||
Reference in New Issue
Block a user