Re: Fix bogus use of "long" in aset.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fix bogus use of "long" in aset.c
Date
Msg-id 2923922.1761782112@sss.pgh.pa.us
Whole thread Raw
In response to Fix bogus use of "long" in aset.c  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Fix bogus use of "long" in aset.c
List pgsql-hackers
David Rowley <dgrowleyml@gmail.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: abi-compliance-check failure due to recent changes to pg_{clear,restore}_{attribute,relation}_stats()
Next
From: Jeff Davis
Date:
Subject: Re: Use BumpContext contexts for TupleHashTables' tablecxt