Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
084f2c4b
Commit
084f2c4b
authored
Mar 09, 2016
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3668 from libgit2/cmn/mwindow-try-harder
mwindow: free unused windows if we fail to mmap
parents
c68044a8
d50fd571
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
src/mwindow.c
+12
-2
No files found.
src/mwindow.c
View file @
084f2c4b
...
...
@@ -296,8 +296,18 @@ static git_mwindow *new_window(
*/
if
(
git_futils_mmap_ro
(
&
w
->
window_map
,
fd
,
w
->
offset
,
(
size_t
)
len
)
<
0
)
{
git__free
(
w
);
return
NULL
;
/*
* The first error might be down to memory fragmentation even if
* we're below our soft limits, so free up what we can and try again.
*/
while
(
git_mwindow_close_lru
(
mwf
)
==
0
)
/* nop */
;
if
(
git_futils_mmap_ro
(
&
w
->
window_map
,
fd
,
w
->
offset
,
(
size_t
)
len
)
<
0
)
{
git__free
(
w
);
return
NULL
;
}
}
ctl
->
mmap_calls
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment