- Notifications
You must be signed in to change notification settings - Fork5.2k
Commit07e9e28
committed
Add pg_memory_is_all_zeros() in memutils.h
This new function tests if a memory region starting at a given locationfor a defined length is made only of zeroes. This unifies in a singlepath the all-zero checks that were happening in a couple of places ofthe backend code:- For pgstats entries of relation, checkpointer and bgwriter, wheresome "all_zeroes" variables were previously used with memcpy().- For all-zero buffer pages in PageIsVerifiedExtended().This new function uses the same forward scan as the check for all-zerobuffer pages, applying it to the three pgstats paths mentioned above.Author: Bertrand DrouvotReviewed-by: Peter Eisentraut, Heikki Linnakangas, Peter SmithDiscussion:https://postgr.es/m/ZupUDDyf1hHI4ibn@ip-10-97-1-34.eu-west-3.compute.internal1 parent49d6c7d commit07e9e28
File tree
5 files changed
+26
-23
lines changed- src
- backend
- storage/page
- utils/activity
- include/utils
5 files changed
+26
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | 92 | | |
94 | 93 | | |
95 | | - | |
96 | 94 | | |
97 | 95 | | |
98 | 96 | | |
| |||
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
129 | | - | |
130 | 127 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | 128 | | |
140 | | - | |
| 129 | + | |
141 | 130 | | |
142 | 131 | | |
143 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | | - | |
| 42 | + | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
803 | | - | |
804 | 803 | | |
805 | 804 | | |
806 | 805 | | |
| |||
815 | 814 | | |
816 | 815 | | |
817 | 816 | | |
818 | | - | |
819 | | - | |
820 | | - | |
| 817 | + | |
| 818 | + | |
821 | 819 | | |
822 | | - | |
823 | 820 | | |
824 | 821 | | |
825 | 822 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
192 | 209 | | |
0 commit comments
Comments
(0)