You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, this is very cool - thank you for sharing it!!
In tlsf.c, the definition of block_size_min seems too small.
My reasoning is that a free block must have the size, next_free and prev_free pointers at the start, plus hold the prev_phys_block pointer at the end (from the next block in memory).
So it seems it should be sizeof(block_header_t) exactly?
I think it probably works because when asking for even 1 byte it is rounded up to 4 bytes, and hence provides a structure of 16 bytes.
/*
** A free block must be large enough to store its header minus the size of
** the prev_phys_block field, and no larger than the number of addressable
** bits for FL_INDEX.
*/
#define block_size_min (sizeof(block_header_t) - sizeof(block_header_t*))
The text was updated successfully, but these errors were encountered:
Firstly, this is very cool - thank you for sharing it!!
In
tlsf.c
, the definition ofblock_size_min
seems too small.My reasoning is that a free block must have the
size
,next_free
andprev_free
pointers at the start, plus hold theprev_phys_block
pointer at the end (from the next block in memory).So it seems it should be
sizeof(block_header_t)
exactly?I think it probably works because when asking for even 1 byte it is rounded up to 4 bytes, and hence provides a structure of 16 bytes.
The text was updated successfully, but these errors were encountered: