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

Commite819bbb

Browse files
committed
Remove use of pg_memory_is_all_zeros() in bufpage.c
After a closer lookup, this makes the all-zero check of the page moreexpensive, so let's remove the new function call in bufpage.c. Themaths of the check were also incorrect, checking that the page was fullof zeros only for the first 1kB.This brings back the code to the state it was at49d6c7d.Per discussion with David Rowley and Bertrand Drouvot.Discussion:https://postgr.es/m/CAApHDvrXzPAr3FxoBuB7b3D-okNoNA2jxLun1rW8Yw5wkbqusw@mail.gmail.com
1 parent07e9e28 commite819bbb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎src/backend/storage/page/bufpage.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ PageIsVerifiedExtended(Page page, BlockNumber blkno, int flags)
8989
{
9090
PageHeaderp= (PageHeader)page;
9191
size_t*pagebytes;
92+
inti;
9293
boolchecksum_failure= false;
9394
boolheader_sane= false;
95+
boolall_zeroes= false;
9496
uint16checksum=0;
9597

9698
/*
@@ -124,9 +126,18 @@ PageIsVerifiedExtended(Page page, BlockNumber blkno, int flags)
124126
}
125127

126128
/* Check all-zeroes case */
129+
all_zeroes= true;
127130
pagebytes= (size_t*)page;
131+
for (i=0;i< (BLCKSZ /sizeof(size_t));i++)
132+
{
133+
if (pagebytes[i]!=0)
134+
{
135+
all_zeroes= false;
136+
break;
137+
}
138+
}
128139

129-
if (pg_memory_is_all_zeros(pagebytes, (BLCKSZ /sizeof(size_t))))
140+
if (all_zeroes)
130141
return true;
131142

132143
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp