Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2196021/?format=api
{ "id": 2196021, "url": "http://patchwork.ozlabs.org/api/patches/2196021/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20260212182031.107003-5-eggert@cs.ucla.edu/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260212182031.107003-5-eggert@cs.ucla.edu>", "list_archive_url": null, "date": "2026-02-12T18:18:14", "name": "[v3,4/4] malloc: alignment might change in future versions", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "4b44466c0b070143cf0d0940e7a90eaf0c5611b9", "submitter": { "id": 4434, "url": "http://patchwork.ozlabs.org/api/people/4434/?format=api", "name": "Paul Eggert", "email": "eggert@CS.UCLA.EDU" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20260212182031.107003-5-eggert@cs.ucla.edu/mbox/", "series": [ { "id": 492003, "url": "http://patchwork.ozlabs.org/api/series/492003/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=492003", "date": "2026-02-12T18:18:14", "name": "malloc doc fixes for alignment", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/492003/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2196021/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196021/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "libc-alpha@sourceware.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "libc-alpha@sourceware.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=cs.ucla.edu header.i=@cs.ucla.edu header.a=rsa-sha256\n header.s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C header.b=OetOx54i;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=cs.ucla.edu header.i=@cs.ucla.edu header.a=rsa-sha256\n header.s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C header.b=OetOx54i", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=cs.ucla.edu", "sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu", "server2.sourceware.org;\n arc=none smtp.remote-ip=131.179.128.66", "mail.cs.ucla.edu (amavis); dkim=pass (2048-bit key)\n header.d=cs.ucla.edu" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fBkCR1j88z1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 05:21:39 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 5497F4B9DB51\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 18:21:37 +0000 (GMT)", "from mail.cs.ucla.edu (mail.cs.ucla.edu [131.179.128.66])\n by sourceware.org (Postfix) with ESMTPS id 04C974BA23E1\n for <libc-alpha@sourceware.org>; Thu, 12 Feb 2026 18:21:01 +0000 (GMT)", "from localhost (localhost [127.0.0.1])\n by mail.cs.ucla.edu (Postfix) with ESMTP id 5E6F83C03E9ED;\n Thu, 12 Feb 2026 10:21:00 -0800 (PST)", "from mail.cs.ucla.edu ([127.0.0.1])\n by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP\n id 6Pf1pvhTN2Xm; Thu, 12 Feb 2026 10:21:00 -0800 (PST)", "from localhost (localhost [127.0.0.1])\n by mail.cs.ucla.edu (Postfix) with ESMTP id 38A613C03E9F0;\n Thu, 12 Feb 2026 10:21:00 -0800 (PST)", "from mail.cs.ucla.edu ([127.0.0.1])\n by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP\n id nBzY3ydtifCz; Thu, 12 Feb 2026 10:21:00 -0800 (PST)", "from wing.home (47-154-25-30.fdr01.snmn.ca.ip.frontiernet.net\n [47.154.25.30])\n by mail.cs.ucla.edu (Postfix) with ESMTPSA id 1B81B3C03E9ED;\n Thu, 12 Feb 2026 10:21:00 -0800 (PST)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 5497F4B9DB51", "OpenDKIM Filter v2.11.0 sourceware.org 04C974BA23E1", "OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 38A613C03E9F0" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 04C974BA23E1", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 04C974BA23E1", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770920461; cv=none;\n b=GIFQY/JnJaxKXFwB+Rlea3gsqk3TJi4lZkM5RjKgaeW1g79t+MDA9e0hjtialtAPRpDivevnvNsZ0RrZwHEEKBt+Qat0by/ZzlLGJHhIQygn3sLrEka0PE5L5N/6ySRwTDyNj9c6I1+QDR4652RF02DTytXb9VXokJrxqZxUqkU=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1770920461; c=relaxed/simple;\n bh=ioSRXr5o/k5pDTdzEbbMCYdNZWV05sMl6+zq8LzFmLg=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=k9pb7H+uGIkHHTFtwSTUbemlyG3MSaL6XG+6j1qIfHgLHa2+3UFCPPMhBuqN7zfAtSm4yDao6fNnd1ZUxANwLEFz2yb29Qy1M9+YD/Y4+VxZKnw70Mu5+XTMmgcpP+K5SjIL5/QtGi1ap8FWp5ZUkziAJUnNS/vKRuYk66XsvBM=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu;\n s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1770920460;\n bh=NXUsn4tvVolGSyzNPG9zY2OE5EK/11544lVwIolkB0w=;\n h=From:To:Date:Message-ID:MIME-Version;\n b=OetOx54iLAsWNP75Ut1VLSbs9WVVLGSWfFWpKeAO67FgquUrWVYdheQWzk1/vuA1Z\n SOXQgdqHYWSHpHUEwKMJyqkCyfMteRNEbAx+W7/R+/OINnJZ6pXCH+t/2icnq44/FE\n kDY0MhqaHKpySILxyzKgmDc49jbxEUFPcOmf1jusDxCz0lumvMbqApcZsRx+4DY6fh\n J2xKvUH6LmOB3eMZnfIqGoBibuqPDv3DVTh0UWq09qSyREzAy7ngxEA/Qhp7suQYIu\n Aibtb3IczzwFHQSRcjFWMNulO1PuoRxnTz8pUsi2D2fU3Y+PKP/oFQ4rykN8NRU9qa\n /MeBCQuriONyQ==", "X-Virus-Scanned": "amavis at mail.cs.ucla.edu", "From": "Paul Eggert <eggert@cs.ucla.edu>", "To": "libc-alpha@sourceware.org", "Cc": "Paul Eggert <eggert@cs.ucla.edu>", "Subject": "[PATCH v3 4/4] malloc: alignment might change in future versions", "Date": "Thu, 12 Feb 2026 10:18:14 -0800", "Message-ID": "<20260212182031.107003-5-eggert@cs.ucla.edu>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20260212182031.107003-1-eggert@cs.ucla.edu>", "References": "<20260212182031.107003-1-eggert@cs.ucla.edu>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "quoted-printable", "X-BeenThere": "libc-alpha@sourceware.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Libc-alpha mailing list <libc-alpha.sourceware.org>", "List-Unsubscribe": "<https://sourceware.org/mailman/options/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe>", "List-Archive": "<https://sourceware.org/pipermail/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-request@sourceware.org?subject=help>", "List-Subscribe": "<https://sourceware.org/mailman/listinfo/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=subscribe>", "Errors-To": "libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org" }, "content": "This follows up on a comment by Wilco Dijkstra; see:\nhttps://sourceware.org/pipermail/libc-alpha/2026-February/174934.html\n* NEWS: Mention this.\n* manual/lang.texi (Important Data Types):\nSay that alignof (max_align_t) might change.\n* manual/memory.texi (Malloc Examples):\nSay that alignment guarantee might change for small allocations.\n---\n NEWS | 7 ++++++-\n manual/lang.texi | 2 +-\n manual/memory.texi | 8 ++++++--\n 3 files changed, 13 insertions(+), 4 deletions(-)", "diff": "diff --git a/NEWS b/NEWS\nindex c63d9d6470..46590a996c 100644\n--- a/NEWS\n+++ b/NEWS\n@@ -13,7 +13,12 @@ Major new features:\n \n Deprecated and removed features, and other changes affecting compatibility:\n \n- [Add deprecations, removals and changes affecting compatibility here]\n+* Although malloc and related functions currently return pointers\n+ aligned to alignof (max_align_t), the documentation now says future\n+ versions of glibc may relax alignment requirements for small allocations.\n+ For example, a future malloc (1) might return a pointer with odd\n+ alignment, because no object of size 1 can have a fundamental\n+ alignment greater than 1.\n \n Changes to build and runtime requirements:\n \ndiff --git a/manual/lang.texi b/manual/lang.texi\nindex 28e7de2b2c..925cdacc1f 100644\n--- a/manual/lang.texi\n+++ b/manual/lang.texi\n@@ -597,7 +597,7 @@ types have a fundamental alignment and lack stricter alignment specifiers.\n In @theglibc{}, the value of @code{alignof (max_align_t)} is 16 on\n most architectures. However, it is 8 on 32-bit architectures that do\n not require 16-byte alignment from @code{malloc} to support predefined\n-types.\n+types. The value may change in future releases.\n \n @strong{Compatibility Note:} The C11 standard introduced @code{max_align_t};\n older compilers may lack the type.\ndiff --git a/manual/memory.texi b/manual/memory.texi\nindex 935df79e9c..4f0ef51514 100644\n--- a/manual/memory.texi\n+++ b/manual/memory.texi\n@@ -653,13 +653,17 @@ savestring (const char *ptr, size_t len)\n @end group\n @end smallexample\n \n-In @theglibc{}, the block that @code{malloc} gives you is guaranteed\n-to be aligned so that its address is a multiple of\n+In the current release of @theglibc{}, the block that @code{malloc} gives you is\n+aligned so that its address is a multiple of\n @code{alignof (max_align_t)}, so that it can hold object types\n with any fundamental alignment and without stricter alignment specifiers.\n Only rarely is any higher boundary (such as a page\n boundary) necessary; for those cases, use @code{aligned_alloc} or\n @code{posix_memalign} (@pxref{Aligned Memory Blocks}).\n+Future releases of @theglibc{} may relax alignment for small allocations,\n+so long as any object with fundamental alignment that fits in the small\n+allocation will be properly aligned. For example, a future @code{malloc (1)}\n+might return a pointer with odd alignment.\n \n Note that the memory located after the end of the block is likely to be\n in use for something else; perhaps a block already allocated by another\n", "prefixes": [ "v3", "4/4" ] }