Commit 86ddd58
packed-backend: mmap large "packed-refs" file during fsck
During fsck, we use "strbuf_read" to read the content of "packed-refs"
without using mmap mechanism. This is a bad practice which would consume
more memory than using mmap mechanism. Besides, as all code paths in
"packed-backend.c" use this way, we should make "fsck" align with the
current codebase.
As we have introduced the helper function "allocate_snapshot_buffer", we
can simply use this function to use mmap mechanism.
Suggested-by: Jeff King <[email protected]>
Suggested-by: Patrick Steinhardt <[email protected]>
Signed-off-by: shejialuo <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent a0dee3f commit 86ddd58
1 file changed
+7
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2068 | 2068 | | |
2069 | 2069 | | |
2070 | 2070 | | |
2071 | | - | |
| 2071 | + | |
2072 | 2072 | | |
2073 | 2073 | | |
2074 | 2074 | | |
| |||
2112 | 2112 | | |
2113 | 2113 | | |
2114 | 2114 | | |
2115 | | - | |
| 2115 | + | |
2116 | 2116 | | |
2117 | 2117 | | |
2118 | 2118 | | |
| |||
2121 | 2121 | | |
2122 | 2122 | | |
2123 | 2123 | | |
2124 | | - | |
2125 | | - | |
2126 | | - | |
2127 | | - | |
2128 | | - | |
2129 | | - | |
2130 | | - | |
| 2124 | + | |
| 2125 | + | |
2131 | 2126 | | |
2132 | | - | |
2133 | | - | |
| 2127 | + | |
| 2128 | + | |
2134 | 2129 | | |
2135 | 2130 | | |
2136 | 2131 | | |
2137 | 2132 | | |
2138 | | - | |
| 2133 | + | |
2139 | 2134 | | |
2140 | 2135 | | |
2141 | 2136 | | |
| |||
0 commit comments