malloc_counter.hpp File
Included Headers
Typedefs Index
| using | malloc_count_callback_type = void(void *cookie, size_t current) |
Functions Index
| size_t | malloc_count_current (void) |
| size_t | malloc_count_peak (void) |
| void | malloc_count_reset_peak (void) |
| size_t | malloc_count_num_allocs (void) |
| void | malloc_count_set_callback (malloc_count_callback_type *cb, void *cookie) |
| void | malloc_count_print_status (void) |
| void | malloc_count_start_monitoring (void) |
| void | malloc_count_stop_monitoring (void) |
| size_t | malloc_count_thread_allocs (void) |
Macro Definitions Index
| #define | EXPECT_N_MALLOCS(statement, n_mallocs) ... |
| #define | EXPECT_NO_MALLOC(statement) EXPECT_N_MALLOCS(statement, 0) |
Typedefs
malloc_count_callback_type
|
Definition at line 61 of file malloc_counter.hpp.
Functions
malloc_count_current()
|
Declaration at line 49 of file malloc_counter.hpp, definition at line 91 of file malloc_counter.cpp.
malloc_count_num_allocs()
|
Declaration at line 58 of file malloc_counter.hpp, definition at line 106 of file malloc_counter.cpp.
malloc_count_peak()
|
Declaration at line 52 of file malloc_counter.hpp, definition at line 96 of file malloc_counter.cpp.
malloc_count_print_status()
|
Declaration at line 69 of file malloc_counter.hpp, definition at line 111 of file malloc_counter.cpp.
malloc_count_reset_peak()
|
Declaration at line 55 of file malloc_counter.hpp, definition at line 101 of file malloc_counter.cpp.
malloc_count_set_callback()
|
Declaration at line 66 of file malloc_counter.hpp, definition at line 116 of file malloc_counter.cpp.
malloc_count_start_monitoring()
|
Declaration at line 72 of file malloc_counter.hpp, definition at line 122 of file malloc_counter.cpp.
malloc_count_stop_monitoring()
|
Declaration at line 75 of file malloc_counter.hpp, definition at line 134 of file malloc_counter.cpp.
malloc_count_thread_allocs()
|
Declaration at line 78 of file malloc_counter.hpp, definition at line 139 of file malloc_counter.cpp.
Macro Definitions
EXPECT_N_MALLOCS
|
- Value
-
malloc_count_start_monitoring(); \ statement; \ do \ { \ const size_t total_allocations = malloc_count_thread_allocs(); \ malloc_count_stop_monitoring(); \ EXPECT_EQ(static_cast<int>(total_allocations), n_mallocs) \ << "Expected " << n_mallocs << " allocations, but found " << total_allocations << " calls to operator new"; \ } while (0)
Definition at line 88 of file malloc_counter.hpp.
EXPECT_NO_MALLOC
|
Definition at line 100 of file malloc_counter.hpp.
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.