diff options
Diffstat (limited to 'src/malloc_hook-inl.h')
-rw-r--r-- | src/malloc_hook-inl.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/malloc_hook-inl.h b/src/malloc_hook-inl.h index 027d6e2..b24b1c6 100644 --- a/src/malloc_hook-inl.h +++ b/src/malloc_hook-inl.h @@ -142,7 +142,9 @@ extern HookList<MallocHook::NewHook> new_hooks_; extern HookList<MallocHook::DeleteHook> delete_hooks_; extern HookList<MallocHook::PreMmapHook> premmap_hooks_; extern HookList<MallocHook::MmapHook> mmap_hooks_; +extern HookList<MallocHook::MmapReplacement> mmap_replacement_; extern HookList<MallocHook::MunmapHook> munmap_hooks_; +extern HookList<MallocHook::MunmapReplacement> munmap_replacement_; extern HookList<MallocHook::MremapHook> mremap_hooks_; extern HookList<MallocHook::PreSbrkHook> presbrk_hooks_; extern HookList<MallocHook::SbrkHook> sbrk_hooks_; @@ -225,6 +227,22 @@ inline void MallocHook::InvokeMmapHook(const void* result, // End DEPRECATED code. } +inline bool MallocHook::InvokeMmapReplacement(const void* start, + size_t size, + int protection, + int flags, + int fd, + off_t offset, + void** result) { + if (!base::internal::mmap_replacement_.empty()) { + return InvokeMmapReplacementSlow(start, size, + protection, flags, + fd, offset, + result); + } + return false; +} + // The following method is DEPRECATED inline MallocHook::MunmapHook MallocHook::GetMunmapHook() { return base::internal::munmap_hook_.Get(); @@ -240,6 +258,14 @@ inline void MallocHook::InvokeMunmapHook(const void* p, size_t size) { // End DEPRECATED code. } +inline bool MallocHook::InvokeMunmapReplacement( + const void* p, size_t size, int* result) { + if (!base::internal::mmap_replacement_.empty()) { + return InvokeMunmapReplacementSlow(p, size, result); + } + return false; +} + // The following method is DEPRECATED inline MallocHook::MremapHook MallocHook::GetMremapHook() { return base::internal::mremap_hook_.Get(); |