Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit705ec05

Browse files
committed
Fix incorrect KeeperBlock macro in bump.c
The macro was missing a MAXALIGN around the sizeof(BumpContext) whichwould cause problems detecting the keeper block on 32-bit systems thathave a MAXALIGN value of 8.Thank you to Andres Freund, Tomas Vondra and Tom Lane for investigatingand testing.Reported-by: Melanie Plageman, Tomas VondraDiscussion:https://postgr.es/m/CAAKRu_Y6dZjiJEZghgNZp0Gjar1JVq-CH7XGDqExDVHnPgDjuw@mail.gmail.comDiscussion:https://postgr.es/m/a4a10b89-6ba8-4abd-b449-019aafff04fc@enterprisedb.com
1 parentbeabea6 commit705ec05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/backend/utils/mmgr/bump.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
#defineBump_CHUNK_FRACTION8
5858

5959
/* The keeper block is allocated in the same allocation as the set */
60-
#defineKeeperBlock(set) ((BumpBlock *) ((char *) (set) + sizeof(BumpContext)))
60+
#defineKeeperBlock(set) ((BumpBlock *) ((char *) (set) + \
61+
MAXALIGN(sizeof(BumpContext))))
6162
#defineIsKeeperBlock(set,blk) (KeeperBlock(set) == (blk))
6263

6364
typedefstructBumpBlockBumpBlock;/* forward reference */
@@ -198,7 +199,7 @@ BumpContextCreate(MemoryContext parent, const char *name, Size minContextSize,
198199
dlist_init(&set->blocks);
199200

200201
/* Fill in the initial block's block header */
201-
block=(BumpBlock*) (((char*)set)+MAXALIGN(sizeof(BumpContext)));
202+
block=KeeperBlock(set);
202203
/* determine the block size and initialize it */
203204
firstBlockSize=allocSize-MAXALIGN(sizeof(BumpContext));
204205
BumpBlockInit(set,block,firstBlockSize);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp