From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by gnuweeb.org (Postfix) with ESMTP id 5C7F97E2C4 for ; Sun, 20 Mar 2022 16:47:04 +0000 (UTC) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 22KGkruP026950; Sun, 20 Mar 2022 17:46:53 +0100 Date: Sun, 20 Mar 2022 17:46:53 +0100 From: Willy Tarreau To: Ammar Faizi Cc: "Paul E. McKenney" , Alviro Iskandar Setiawan , Nugraha , Linux Kernel Mailing List , GNU/Weeb Mailing List Subject: Re: [RFC PATCH v1 5/6] tools/nolibc/stdlib: Implement `malloc()`, `calloc()`, `realloc()` and `free()` Message-ID: <20220320164653.GA26917@1wt.eu> References: <20220320093750.159991-1-ammarfaizi2@gnuweeb.org> <20220320093750.159991-6-ammarfaizi2@gnuweeb.org> <20220320161644.GF8067@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: On Sun, Mar 20, 2022 at 11:36:55PM +0700, Ammar Faizi wrote: > And this is what GCC doc says about __attribute__((__aligned__)): > """ > The aligned attribute specifies a minimum alignment for the variable > or structure field, measured in bytes. When specified, alignment must > be an integer constant power of 2. Specifying no alignment argument > implies the maximum alignment for the target, which is often, but by > no means always, 8 or 16 bytes. > """ > > Link: https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gcc/Common-Variable-Attributes.html#Common-Variable-Attributes OK then that's fine, thank you. I thought it would force the alignment to the type itself. > Simple experiment on Linux x86-64... That's even easier checked like this: $ cat > c.c <