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

Unified Diff: base/file_descriptor_shuffle.h

Issue 672003: POSIX: don't allocate memory after forking. (Closed)
Patch Set: ... Created 10 years, 9 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 | « base/dir_reader_posix_unittest.cc ('k') | base/file_descriptor_shuffle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_descriptor_shuffle.h
diff --git a/base/file_descriptor_shuffle.h b/base/file_descriptor_shuffle.h
index e0cb88b8552b39dac9abe1bd86b178e3690b07de..e1c93cd3d45e2bc4ccb95e13a8dcb74547a001d6 100644
--- a/base/file_descriptor_shuffle.h
+++ b/base/file_descriptor_shuffle.h
@@ -69,9 +69,13 @@ typedef std::vector<InjectionArc> InjectiveMultimap;
bool PerformInjectiveMultimap(const InjectiveMultimap& map,
InjectionDelegate* delegate);
-static inline bool ShuffleFileDescriptors(const InjectiveMultimap& map) {
+bool PerformInjectiveMultimapDestructive(InjectiveMultimap* map,
+ InjectionDelegate* delegate);
+
+// This function will not call malloc but will mutate |map|
+static inline bool ShuffleFileDescriptors(InjectiveMultimap* map) {
FileDescriptorTableInjection delegate;
- return PerformInjectiveMultimap(map, &delegate);
+ return PerformInjectiveMultimapDestructive(map, &delegate);
}
} // namespace base
« no previous file with comments | « base/dir_reader_posix_unittest.cc ('k') | base/file_descriptor_shuffle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698