Commit graph

8 commits

Author SHA1 Message Date
Guillaume Souchere
1ca1da2407 tlsf: move control_t to tlsf.c
- the control_t structure should not be available to the user so it
was moved to tlsf.c. In addition bitfields are now used in control_t
when possible which reduces the size of the structure from 56 bytes
to 36 bytes.

- fix an assert message to place it in the tlsf_assert

- add comment about the index count log2 field in control_t
2022-10-21 11:14:44 +02:00
Guillaume Souchere
049f54327a tlsf: update calculation of fl index max
The calculation of fl index max is changed to always be the smallest
number that includes the size of the registered memory.

The control_construct() function now checks for minimum size as the control structure
parameters are calculated.

There is no longer a minimum configuration for fl index max so the tlsf_config
enum is striped down to remove unecessary compile time values.

the tlsf_size() function will fail if no tlsf pointer is passed as parameter since there
is no way to calculate a default tlsf size anymore.
2022-10-18 07:39:44 +02:00
X-Ryl669
4d43b0df1c Multiple heap TLSF 2022-09-20 10:22:27 +02:00
Ivan Grokhotkov
b76f0fefd1 Add heap poisoning mechanism to fill absorbed block header with the right pattern.
Note: block_absorb() is called in tlsf_free(), which is eventually called in multi_heap_free()
after the memory fill is done. As the block_absorb merges 2 blocks together, the previous block
header of the merged block is now in the middle of the memory block but not filled with 0xfe.

- Remove dependencies with the heap component of the IDF.
- The tlsf_poison_fill_region_hook() function is defined as weak in IDF and checked for NULL
in block_absorb() function in order to minimize the dependencies between IDF and the TLSF.
- The the implementation of tlsf_poison_fill_region_hook() must be provided at the discretion
of the user.
2022-07-26 14:40:25 +02:00
Guillaume Souchere
81cecf2e0d move block_header_t, control_t, tlsfptr_t to tlsf_common.h and block function to tlsf_block_functions.h 2022-07-26 14:39:07 +02:00
Ivan Grokhotkov
bfd855894d move tlsf_min, tlsf_max, tlsf_cast to the tlsf_common.h header file 2022-07-26 14:38:30 +02:00
Ivan Grokhotkov
6723d4fc98 tlsf_public and tlsf_private moved to tlsf_config enum in tlsf_common.h header 2022-07-26 14:38:30 +02:00
Ivan Grokhotkov
1f77a1d2a1 add tlsf_block_functions.h and tlsf_common.h files 2022-07-26 14:38:30 +02:00