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

Commit60369db

Browse files
committed
Fix calculation of how much shared memory is required to store a TOC.
Commitac883ac refactored shm_toc_estimate() but changed its calculationof shared memory size for TOC incorrectly. Previously this could cause toolarge memory to be allocated.Back-patch to v11 where the bug was introduced.Author: Takayuki TsunakawaDiscussion:https://postgr.es/m/TYAPR01MB2990BFB73170E2C4921E2C4DFEA80@TYAPR01MB2990.jpnprd01.prod.outlook.com
1 parent79d3ac7 commit60369db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/storage/ipc/shm_toc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ shm_toc_estimate(shm_toc_estimator *e)
265265
Sizesz;
266266

267267
sz= offsetof(shm_toc,toc_entry);
268-
sz+=add_size(sz,mul_size(e->number_of_keys,sizeof(shm_toc_entry)));
269-
sz+=add_size(sz,e->space_for_chunks);
268+
sz=add_size(sz,mul_size(e->number_of_keys,sizeof(shm_toc_entry)));
269+
sz=add_size(sz,e->space_for_chunks);
270270

271271
returnBUFFERALIGN(sz);
272272
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp