diff options
Diffstat (limited to 'base/file_descriptor_shuffle.h')
-rw-r--r-- | base/file_descriptor_shuffle.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/base/file_descriptor_shuffle.h b/base/file_descriptor_shuffle.h index e0cb88b..e1c93cd 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 |