[PATCH 0/9] tlsf: use 8-byte alignment for normal malloc allocations

Sascha Hauer sha at pengutronix.de
Fri Oct 14 01:54:53 PDT 2022


On Tue, Oct 04, 2022 at 05:53:58PM +0200, Ahmad Fatoum wrote:
> TLSF currently uses only 4-byte alignment on 32-bit platforms, which isn't
> enough for ldrd/strd on ARMv7. This series reworks TLSF a bit, so we always
> have at least 8 byte alignment.  dlmalloc already has 8 byte alignment
> minimum, so nothing to do there.
> 
> While this fixes real issues like what Enrico ran into, I'd suggest we only
> this be taken into next only after v2022.10.0 is tagged, so this can get
> some more testing exposure in the mean time.
> 
> Ahmad Fatoum (9):
>   test: include <linux/printk.h>
>   tlsf: use bselftest for testing ffs/fls
>   tlsf: ensure malloc pool is aligned
>   tlsf: fix sizeof(size_t) == sizeof(void *) assumption
>   tlsf: decouple maximum allocation size from sizeof(size_t)
>   tlsf: use 8-byte alignment for normal malloc allocations
>   common: malloc: ensure alignment is always at least 8 byte
>   test: self: refactor to allow alignment check
>   test: self: malloc: fix memory leaks

Applied, thanks

Sascha

> 
>  common/Kconfig        |  5 +++
>  common/dlmalloc.c     |  3 ++
>  common/dummy_malloc.c |  2 +-
>  common/tlsf.c         | 72 ++++++++++++++++-----------------
>  include/bselftest.h   |  1 +
>  test/self/malloc.c    | 92 ++++++++++++++++++++++++++++++++-----------
>  6 files changed, 114 insertions(+), 61 deletions(-)
> 
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list