| OLD | NEW |
| 1 // Copyright (c) 2005, Google Inc. | 1 // Copyright (c) 2005, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 MallocHook::MremapHook hook = MallocHook::GetMremapHook(); | 163 MallocHook::MremapHook hook = MallocHook::GetMremapHook(); |
| 164 if (hook != NULL) (*hook)(result, | 164 if (hook != NULL) (*hook)(result, |
| 165 old_addr, old_size, | 165 old_addr, old_size, |
| 166 new_size, flags, new_addr); | 166 new_size, flags, new_addr); |
| 167 } | 167 } |
| 168 | 168 |
| 169 inline MallocHook::PreSbrkHook MallocHook::GetPreSbrkHook() { | 169 inline MallocHook::PreSbrkHook MallocHook::GetPreSbrkHook() { |
| 170 return base::internal::presbrk_hook_.Get(); | 170 return base::internal::presbrk_hook_.Get(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 inline void MallocHook::InvokePreSbrkHook(ptrdiff_t increment) { | 173 inline void MallocHook::InvokePreSbrkHook(std::ptrdiff_t increment) { |
| 174 MallocHook::PreSbrkHook hook = MallocHook::GetPreSbrkHook(); | 174 MallocHook::PreSbrkHook hook = MallocHook::GetPreSbrkHook(); |
| 175 if (hook != NULL && increment != 0) (*hook)(increment); | 175 if (hook != NULL && increment != 0) (*hook)(increment); |
| 176 } | 176 } |
| 177 | 177 |
| 178 inline MallocHook::SbrkHook MallocHook::GetSbrkHook() { | 178 inline MallocHook::SbrkHook MallocHook::GetSbrkHook() { |
| 179 return base::internal::sbrk_hook_.Get(); | 179 return base::internal::sbrk_hook_.Get(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 inline void MallocHook::InvokeSbrkHook(const void* result, | 182 inline void MallocHook::InvokeSbrkHook(const void* result, |
| 183 ptrdiff_t increment) { | 183 std::ptrdiff_t increment) { |
| 184 MallocHook::SbrkHook hook = MallocHook::GetSbrkHook(); | 184 MallocHook::SbrkHook hook = MallocHook::GetSbrkHook(); |
| 185 if (hook != NULL && increment != 0) (*hook)(result, increment); | 185 if (hook != NULL && increment != 0) (*hook)(result, increment); |
| 186 } | 186 } |
| 187 | 187 |
| 188 #endif /* _MALLOC_HOOK_INL_H_ */ | 188 #endif /* _MALLOC_HOOK_INL_H_ */ |
| OLD | NEW |