Oct 22, 2025 9:28:07 AM Richard Biener <[email protected]>:

> On Wed, Oct 22, 2025 at 2:22 AM Peter Damianov <[email protected]> wrote:
>>
>> C23 adds a memalignment function to determine the alignment of a pointer.
>> Given how simple it is (convert pointer to an integer then return (p & -p)),
>> GCC should support expanding it inline.
>>
>> This patch implements __builtin_memalignment which expands to p & -p
>
> Does C23 add '__builtin_memalignment' literally?  If not, why do we need
> an indirection through a builtin and not implement that in terms of p & -p
> directly?

I don't understand this question. I did check the following:

size_t memalignment(void*);

And the call to it was inline.

Could you please elaborate?

Reply via email to