Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1849)

Unified Diff: android/library_loader/library_prefetcher.cc

Issue 2050803003: Update to Chromium //base at Chromium commit e3a753f17bac62738b0dbf0b36510f767b081e4b. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android/library_loader/library_loader_hooks.cc ('k') | android/memory_pressure_listener_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android/library_loader/library_prefetcher.cc
diff --git a/android/library_loader/library_prefetcher.cc b/android/library_loader/library_prefetcher.cc
index 9b54843fc8329c978b5b9e36a61e88a15f6c7c3a..4c47bed178883c1e6d6de4af430cd4b8499465d6 100644
--- a/android/library_loader/library_prefetcher.cc
+++ b/android/library_loader/library_prefetcher.cc
@@ -118,6 +118,12 @@ bool NativeLibraryPrefetcher::FindRanges(std::vector<AddressRange>* ranges) {
// static
bool NativeLibraryPrefetcher::ForkAndPrefetchNativeLibrary() {
+// Avoid forking with cygprofile instrumentation because the latter performs
+// memory allocations.
+#if defined(CYGPROFILE_INSTRUMENTATION)
+ return false;
+#endif
+
// Looking for ranges is done before the fork, to avoid syscalls and/or memory
// allocations in the forked process. The child process inherits the lock
// state of its parent thread. It cannot rely on being able to acquire any
@@ -126,6 +132,7 @@ bool NativeLibraryPrefetcher::ForkAndPrefetchNativeLibrary() {
std::vector<AddressRange> ranges;
if (!FindRanges(&ranges))
return false;
+
pid_t pid = fork();
if (pid == 0) {
setpriority(PRIO_PROCESS, 0, kBackgroundPriority);
« no previous file with comments | « android/library_loader/library_loader_hooks.cc ('k') | android/memory_pressure_listener_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698