Re: Changing types of block and chunk sizes in memory contexts - Mailing list pgsql-hackers

From Melih Mutlu
Subject Re: Changing types of block and chunk sizes in memory contexts
Date
Msg-id CAGPVpCTwR408DEm++fXo6qZsKNbJr7B9Cw5mRtO_hp-XTiweyQ@mail.gmail.com
Whole thread Raw
In response to Re: Changing types of block and chunk sizes in memory contexts  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Changing types of block and chunk sizes in memory contexts
List pgsql-hackers
Hi David,

David Rowley <dgrowleyml@gmail.com>, 13 Tem 2023 Per, 08:04 tarihinde şunu yazdı:
I looked at your v2 patch. The only thing that really looked wrong
were the (Size) casts in the context creation functions.  These should
have been casts to uint32 rather than Size. Basically, all the casts
do is say to the compiler "Yes, I know this could cause truncation due
to assigning to a size smaller than the source type's size". Some
compilers will likely warn without that and the cast will stop them.
We know there can't be any truncation due to the Asserts. There's also
the fundamental limitation that MemoryChunk can't store block offsets
larger than 1GBs anyway, so things will go bad if we tried to have
blocks bigger than 1GB.

Right! I don't know why I cast them to Size. Thanks for the fix.

Best,
--
Melih Mutlu
Microsoft

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: logical decoding and replication of sequences, take 2
Next
From: Amit Langote
Date:
Subject: Re: remaining sql/json patches