From: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
To: Sascha Hauer <sha@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: malloc() alignment on 32 bit
Date: Wed, 28 Sep 2022 12:24:23 +0200 [thread overview]
Message-ID: <lyfsgbyey0.fsf@ensc-pc.intern.sigma-chemnitz.de> (raw)
In-Reply-To: <20220920073622.GE6477@pengutronix.de> (Sascha Hauer's message of "Tue, 20 Sep 2022 09:36:22 +0200")
Sascha Hauer <sha@pengutronix.de> writes:
> So it seems it's really a good idea to increase malloc alignment
> accordingly.
But this does not seem to be trivial :(
A naive
| - ALIGN_SIZE_LOG2 = 2,
| + ALIGN_SIZE_LOG2 = 3,
triggers a lot of warnings.
I think, ALIGN_SIZE in tlsf_add_pool() and in the higher level functions
(tlsf_malloc(), _memalign(), _realloc()) should be replaced by a new,
bigger constant.
But this appears invasive and I have no idea about tlsf and the sideeffects :(
There exists https://github.com/mattconte/tlsf/issues/16 which asks for
proper alignment; but project seems to be unmaintained.
Replacing 'malloc()' with 'memalign()' on problems, seems the best idea
for now.
Enrico
prev parent reply other threads:[~2022-09-28 10:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 12:37 Enrico Scholz
2022-09-19 13:33 ` Ahmad Fatoum
2022-09-19 13:57 ` Sascha Hauer
2022-09-19 14:24 ` Enrico Scholz
2022-09-20 7:36 ` Sascha Hauer
2022-09-28 10:24 ` Enrico Scholz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=lyfsgbyey0.fsf@ensc-pc.intern.sigma-chemnitz.de \
--to=enrico.scholz@sigma-chemnitz.de \
--cc=barebox@lists.infradead.org \
--cc=sha@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox