Re: Some efforts to get rid of "long" in our codebase

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Some efforts to get rid of "long" in our codebase
Date: 2025-11-07 16:04:11
Message-ID: 1233593.1762531451@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> I do suggest some kind of comment, that we're using size_t as a
> convenient proxy for the most suitable chunk/step size for the platform,
> not to actually measure a size.

Yeah. There's not actually anything wrong with using "long" here,
except that we believe that on Win64 it's probably not the processor's
native word width. Size/size_t is more likely to match that.

([u]intptr_t is even more likely to match, but I don't think that's a
good choice because it invites confusion with the usage of uintptr_t
for address arithmetic elsewhere in the macro. That's quite unrelated
to the choice of copy step size.)

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2025-11-07 16:05:11 Re: Consistently use the XLogRecPtrIsInvalid() macro
Previous Message Maxim Orlov 2025-11-07 16:03:11 Re: POC: make mxidoff 64 bits