Question on alignment

From: Antonin Houska <ah(at)cybertec(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Question on alignment
Date: 2019-04-01 08:01:05
Message-ID: 2555.1554105665@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In copydir.c:copy_file() I read

/* Use palloc to ensure we get a maxaligned buffer */
buffer = palloc(COPY_BUF_SIZE);

No data type wider than a single byte is used to access the data in the
buffer, and neither read() nor write() should require any specific alignment.
Can someone please explain why alignment matters here?

--
Antonin Houska
Web: https://www.cybertec-postgresql.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2019-04-01 08:16:47 Re: Enable data checksums by default
Previous Message Jamison, Kirk 2019-04-01 07:40:10 RE: Timeout parameters