mirror of
https://github.com/gperftools/gperftools
synced 2025-02-17 20:56:53 +00:00
fix malloc fast path for patched windows functions
malloc_fast_path now receives oom function instead of full allocation function and windows/patch_function.cc wasn't updated until now. It caused assertion failures as reported in issue #944.
This commit is contained in:
parent
8b1d13c631
commit
0bccb5e658
@ -805,7 +805,7 @@ bool PatchAllModules() {
|
||||
|
||||
template<int T>
|
||||
void* LibcInfoWithPatchFunctions<T>::Perftools_malloc(size_t size) __THROW {
|
||||
return malloc_fast_path<tcmalloc::allocate_full_malloc_oom>(size);
|
||||
return malloc_fast_path<tcmalloc::malloc_oom>(size);
|
||||
}
|
||||
|
||||
template<int T>
|
||||
@ -858,12 +858,12 @@ void* LibcInfoWithPatchFunctions<T>::Perftools_calloc(
|
||||
|
||||
template<int T>
|
||||
void* LibcInfoWithPatchFunctions<T>::Perftools_new(size_t size) {
|
||||
return malloc_fast_path<tcmalloc::allocate_full_cpp_throw_oom>(size);
|
||||
return malloc_fast_path<tcmalloc::cpp_throw_oom>(size);
|
||||
}
|
||||
|
||||
template<int T>
|
||||
void* LibcInfoWithPatchFunctions<T>::Perftools_newarray(size_t size) {
|
||||
return malloc_fast_path<tcmalloc::allocate_full_cpp_throw_oom>(size);
|
||||
return malloc_fast_path<tcmalloc::cpp_throw_oom>(size);
|
||||
}
|
||||
|
||||
template<int T>
|
||||
@ -881,13 +881,13 @@ void LibcInfoWithPatchFunctions<T>::Perftools_deletearray(void *p) {
|
||||
template<int T>
|
||||
void* LibcInfoWithPatchFunctions<T>::Perftools_new_nothrow(
|
||||
size_t size, const std::nothrow_t&) __THROW {
|
||||
return malloc_fast_path<tcmalloc::allocate_full_cpp_nothrow_oom>(size);
|
||||
return malloc_fast_path<tcmalloc::cpp_nothrow_oom>(size);
|
||||
}
|
||||
|
||||
template<int T>
|
||||
void* LibcInfoWithPatchFunctions<T>::Perftools_newarray_nothrow(
|
||||
size_t size, const std::nothrow_t&) __THROW {
|
||||
return malloc_fast_path<tcmalloc::allocate_full_cpp_nothrow_oom>(size);
|
||||
return malloc_fast_path<tcmalloc::cpp_nothrow_oom>(size);
|
||||
}
|
||||
|
||||
template<int T>
|
||||
|
Loading…
Reference in New Issue
Block a user