Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c68044a + d50fd57 commit 084f2c4Copy full SHA for 084f2c4
src/mwindow.c
@@ -296,8 +296,18 @@ static git_mwindow *new_window(
296
*/
297
298
if (git_futils_mmap_ro(&w->window_map, fd, w->offset, (size_t)len) < 0) {
299
- git__free(w);
300
- return NULL;
+ /*
+ * The first error might be down to memory fragmentation even if
301
+ * we're below our soft limits, so free up what we can and try again.
302
+ */
303
+
304
+ while (git_mwindow_close_lru(mwf) == 0)
305
+ /* nop */;
306
307
+ if (git_futils_mmap_ro(&w->window_map, fd, w->offset, (size_t)len) < 0) {
308
+ git__free(w);
309
+ return NULL;
310
+ }
311
}
312
313
ctl->mmap_calls++;
0 commit comments