MCPcopy Create free account
hub / github.com/beefytech/Beef / do_malloc_or_cpp_alloc

Function do_malloc_or_cpp_alloc

BeefRT/gperftools/src/tcmalloc.cc:1045–1047  ·  view source on GitHub ↗

TODO(willchan): Investigate whether or not lining this much is harmful to performance. This is equivalent to do_malloc() except when tc_new_mode is set to true. Otherwise, it will run the std::new_handler if set.

Source from the content-addressed store, hash-verified

1043// This is equivalent to do_malloc() except when tc_new_mode is set to true.
1044// Otherwise, it will run the std::new_handler if set.
1045inline void* do_malloc_or_cpp_alloc(size_t size) {
1046 return tc_new_mode ? cpp_alloc(size, true) : do_malloc(size);
1047}
1048
1049inline void* do_malloc_no_errno_or_cpp_alloc(size_t size) {
1050 return tc_new_mode ? cpp_alloc(size, true) : do_malloc_no_errno(size);

Callers 5

do_realloc_with_callbackFunction · 0.70
tc_mallocFunction · 0.70
tc_reallocFunction · 0.70
Perftools_mallocMethod · 0.50
Perftools_reallocMethod · 0.50

Calls 2

cpp_allocFunction · 0.70
do_mallocFunction · 0.70

Tested by

no test coverage detected