Re: Fix bogus use of "long" in aset.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix bogus use of "long" in aset.c
Date: 2025-10-29 23:55:12
Message-ID: 2923922.1761782112@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> It turns out that AllocSetCheck() thinks "long" is a good datatype to
> store the difference between 2 pointers. That's not going to work well
> on 64-bit Windows as long is 32-bit.

Ooops. Surprised we've not noticed this before.

> I did also consider [u]intptr_t, but thought Size was better as that's
> what chsize is.

Seems like it's important that the value be signed, so maybe ssize_t?
Or ptrdiff_t?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2025-10-30 00:08:47 Re: Use BumpContext contexts for TupleHashTables' tablecxt
Previous Message Tom Lane 2025-10-29 23:52:11 Re: abi-compliance-check failure due to recent changes to pg_{clear,restore}_{attribute,relation}_stats()