Re: Add palloc_aligned() to allow arbitrary power of 2 memory alignment - Mailing list pgsql-hackers

From Maxim Orlov
Subject Re: Add palloc_aligned() to allow arbitrary power of 2 memory alignment
Date
Msg-id CACG=ezYXoZFd-LVWsTTqdoGk6RnnmtsbJo+X+9TTgXQ+eT4x1Q@mail.gmail.com
Whole thread Raw
In response to Add palloc_aligned() to allow arbitrary power of 2 memory alignment  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Add palloc_aligned() to allow arbitrary power of 2 memory alignment
List pgsql-hackers
Hi!

Part of the work that Thomas mentions in [1], regarding Direct I/O,
has certain requirements that pointers must be page-aligned.

I've attached a patch which implements palloc_aligned() and
MemoryContextAllocAligned() ...
I've done a quick look and the patch is looks good to me.
Let's add tests for these functions, should we? If you think this is an overkill, feel free to trim tests for your taste.

--
Best regards,
Maxim Orlov.
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Add explicit casts in four places to simplehash.h
Next
From: Tom Lane
Date:
Subject: Re: [BUG] Logical replica crash if there was an error in a function.