mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/9] tlsf: use 8-byte alignment for normal malloc allocations
@ 2022-10-04 15:53 Ahmad Fatoum
  2022-10-04 15:53 ` [PATCH 1/9] test: include <linux/printk.h> Ahmad Fatoum
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: Ahmad Fatoum @ 2022-10-04 15:53 UTC (permalink / raw)
  To: barebox; +Cc: Enrico Scholz

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

 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




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-10-20 13:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 15:53 [PATCH 0/9] tlsf: use 8-byte alignment for normal malloc allocations Ahmad Fatoum
2022-10-04 15:53 ` [PATCH 1/9] test: include <linux/printk.h> Ahmad Fatoum
2022-10-04 15:54 ` [PATCH 2/9] tlsf: use bselftest for testing ffs/fls Ahmad Fatoum
2022-10-04 15:54 ` [PATCH 3/9] tlsf: ensure malloc pool is aligned Ahmad Fatoum
2022-10-04 15:54 ` [PATCH 4/9] tlsf: fix sizeof(size_t) == sizeof(void *) assumption Ahmad Fatoum
2022-10-04 15:54 ` [PATCH 5/9] tlsf: decouple maximum allocation size from sizeof(size_t) Ahmad Fatoum
2022-10-04 15:54 ` [PATCH 6/9] tlsf: use 8-byte alignment for normal malloc allocations Ahmad Fatoum
2022-10-04 15:54 ` [PATCH 7/9] common: malloc: ensure alignment is always at least 8 byte Ahmad Fatoum
2022-10-04 15:54 ` [PATCH 8/9] test: self: refactor to allow alignment check Ahmad Fatoum
2022-10-04 15:54 ` [PATCH 9/9] test: self: malloc: fix memory leaks Ahmad Fatoum
2022-10-04 16:23 ` [PATCH 0/9] tlsf: use 8-byte alignment for normal malloc allocations Enrico Scholz
2022-10-04 16:34   ` Ahmad Fatoum
2022-10-14  8:54 ` Sascha Hauer
2022-10-20 13:11   ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox