From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: [PATCH] Reimplement aligned_alloc
Date: Tue, 19 May 2020 15:24:53 +0200 [thread overview]
Message-ID: <20200519132453.GW3947@calimero.vinschen.de> (raw)
In-Reply-To: <20200519095249.22326-1-szabolcs.nagy@arm.com>
On May 19 10:52, Szabolcs Nagy wrote:
> The original implementation had multiple issues:
>
> - Only worked when posix_memalign was available (Linux, RTEMS).
> - Violated C11 link namespace rules by calling posix_memalign.
> - Failed to set errno on error.
>
> These can be fixed by essentially using the same implementation
> for aligned_alloc as for memalign, i.e. simply calling _memalign_r
> (which is always available and a "more reserved name" although
> technically still not in the reserved link namespace, at least
> code written in c cannot define a colliding symbol, newlib has
> plenty such namespace issues so this is fine).
>
> It is not clear what the right policy is when MALLOC_PROVIDED is set,
> currently that does not cover aligned_alloc so it is kept that way.
>
> Tested on aarch64-none-elf
> ---
> newlib/libc/stdlib/aligned_alloc.c | 62 +++++++++++++++---------------
> 1 file changed, 30 insertions(+), 32 deletions(-)
Pushed.
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
next prev parent reply other threads:[~2020-05-19 13:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 9:52 Szabolcs Nagy
2020-05-19 13:24 ` Corinna Vinschen [this message]
2020-05-19 17:41 ` Sebastian Huber
2020-05-19 21:02 ` Joel Sherrill
2020-05-20 8:54 ` Szabolcs Nagy
2020-05-20 14:32 ` Brian Inglis
2020-05-22 15:22 ` Szabolcs Nagy
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=20200519132453.GW3947@calimero.vinschen.de \
--to=vinschen@redhat.com \
--cc=newlib@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).