Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
glog
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
glog
Commits
d064ab8d
Commit
d064ab8d
authored
Apr 19, 2018
by
Ruslan Baratov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build for Android API < 21
parent
e0341da0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
logging.cc
src/logging.cc
+5
-0
No files found.
src/logging.cc
View file @
d064ab8d
...
...
@@ -1124,8 +1124,13 @@ void LogFileObject::Write(bool force_flush,
uint32
this_drop_length
=
total_drop_length
-
dropped_mem_length_
;
if
(
this_drop_length
>=
(
2
<<
20
))
{
// Only advise when >= 2MiB to drop
# if defined(__ANDROID__) && defined(__ANDROID_API__) && (__ANDROID_API__ < 21)
// 'posix_fadvise' introduced in API 21:
// * https://android.googlesource.com/platform/bionic/+/6880f936173081297be0dc12f687d341b86a4cfa/libc/libc.map.txt#732
# else
posix_fadvise
(
fileno
(
file_
),
dropped_mem_length_
,
this_drop_length
,
POSIX_FADV_DONTNEED
);
# endif
dropped_mem_length_
=
total_drop_length
;
}
}
...
...
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