From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: [PATCH v3 4/4] malloc: alignment might change in future versions
Date: Fri, 13 Feb 2026 16:28:59 +0000 [thread overview]
Message-ID: <PAWPR08MB898258C4A0E87B585FDE9C5E8361A@PAWPR08MB8982.eurprd08.prod.outlook.com> (raw)
Hi Paul,
> This follows up on a comment by Wilco Dijkstra; see:
> https://sourceware.org/pipermail/libc-alpha/2026-February/174934.html
> * NEWS: Mention this.
> * manual/lang.texi (Important Data Types):
> Say that alignof (max_align_t) might change.
> * manual/memory.texi (Malloc Examples):
> Say that alignment guarantee might change for small allocations.
Looks good to me.
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cheers,
Wilco
> +++ b/manual/lang.texi
> @@ -597,7 +597,7 @@ types have a fundamental alignment and lack stricter alignment specifiers.
> In @theglibc{}, the value of @code{alignof (max_align_t)} is 16 on
> most architectures. However, it is 8 on 32-bit architectures that do
> not require 16-byte alignment from @code{malloc} to support predefined
> -types.
> +types. The value may change in future releases.
OK (this includes increasing alignment, eg. for larger blocks).
> -In @theglibc{}, the block that @code{malloc} gives you is guaranteed
> -to be aligned so that its address is a multiple of
> +In the current release of @theglibc{}, the block that @code{malloc} gives you is
> +aligned so that its address is a multiple of
> @code{alignof (max_align_t)}, so that it can hold object types
> with any fundamental alignment and without stricter alignment specifiers.
OK
> Only rarely is any higher boundary (such as a page
> boundary) necessary; for those cases, use @code{aligned_alloc} or
> @code{posix_memalign} (@pxref{Aligned Memory Blocks}).
>+Future releases of @theglibc{} may relax alignment for small allocations,
>+so long as any object with fundamental alignment that fits in the small
>+allocation will be properly aligned. For example, a future @code{malloc (1)}
>+might return a pointer with odd alignment.
OK.
next reply other threads:[~2026-02-13 16:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 16:28 Wilco Dijkstra [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-02-12 18:18 [PATCH v3 0/4] malloc doc fixes for alignment Paul Eggert
2026-02-12 18:18 ` [PATCH v3 4/4] malloc: alignment might change in future versions Paul Eggert
2026-02-26 12:47 ` Florian Weimer
2026-02-26 18:41 ` Paul Eggert
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=PAWPR08MB898258C4A0E87B585FDE9C5E8361A@PAWPR08MB8982.eurprd08.prod.outlook.com \
--to=wilco.dijkstra@arm.com \
--cc=eggert@cs.ucla.edu \
--cc=libc-alpha@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).