diff options
author | Masahiko Sawada <msawada@postgresql.org> | 2024-03-26 13:06:06 +0900 |
---|---|---|
committer | Masahiko Sawada <msawada@postgresql.org> | 2024-03-26 13:06:06 +0900 |
commit | 4edb37e322a64b1c9edd7f0da6fa7cda4541a67c (patch) | |
tree | 2a793217b6e994cb6bc289c50ebedeb03c771771 /src | |
parent | 3a4837fc809a8656374959049f3ac7a09a711334 (diff) | |
download | postgresql-4edb37e322a64b1c9edd7f0da6fa7cda4541a67c.tar.gz postgresql-4edb37e322a64b1c9edd7f0da6fa7cda4541a67c.zip |
Fix a calculation in TidStoreCreate().
Since we expect that the max_bytes is in bytes, not in kilobytes, it
should not be multiplied by 1024.
Introduced by 30e144287a.
Reported-by: John Naylor, David Rowley
Reviewed-by: John Naylor
Discussion: https://postgr.es/m/CANWCAZZTE-14ofsucofTuhFsfuDGBNf%3DNZb22TMYT8bxA41oQQ%40mail.gmail.com
Discussion: https://postgr.es/m/CAApHDvojg82NDaDEpj1WEZSbVTafj%3DDRmW%2BFrkBdW8ScL4OFxA%40mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/common/tidstore.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/common/tidstore.c b/src/backend/access/common/tidstore.c index 745393806d3..f79141590ed 100644 --- a/src/backend/access/common/tidstore.c +++ b/src/backend/access/common/tidstore.c @@ -130,7 +130,7 @@ TidStoreCreate(size_t max_bytes, dsa_area *area, int tranche_id) ts->context = CurrentMemoryContext; /* choose the maxBlockSize to be no larger than 1/16 of max_bytes */ - while (16 * maxBlockSize > max_bytes * 1024L) + while (16 * maxBlockSize > max_bytes) maxBlockSize >>= 1; if (maxBlockSize < ALLOCSET_DEFAULT_INITSIZE) |