#ifdefined(ADDRESS_SANITIZER) || defined(LEAK_SANITIZER) || \ defined(MEMORY_SANITIZER) || defined(THREAD_SANITIZER) || \ defined(UNDEFINED_SANITIZER) // The allocator override mechanism is not available since the // sanitizers override the allocators themselves. #else #define WEBRTC_ALLOCATION_COUNTER_AVAILABLE 1
#include <cstddef>
namespace webrtc {
// Use to count the number of heap allocations that have been performed on the // current thread within the scope of the AllocationCounter. // // * Note1: This class is a test-only utility. In order to be able to count // allocations, AllocationCounter overrides the global new and delete // operators for the test binary. // // * Note2: An AllocationCounter instance must always be used from the same // thread. class AllocationCounter {
public:
AllocationCounter();
~AllocationCounter() = default;
// Returns the number of heap allocations that have been made since // construction.
size_t new_count() const;
size_t delete_count() const;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.