MemViz v1.0.0
C++ Memory Layout Inspector
Loading...
Searching...
No Matches
MemoryTracker.hpp File Reference
#include <vector>
#include <mutex>
#include <cstdint>
#include <iostream>

Go to the source code of this file.

Classes

struct  memviz::AllocationInfo
 
struct  memviz::detail::HookGuard
 

Namespaces

namespace  memviz
 
namespace  memviz::detail
 

Functions

auto memviz::detail::lower_bound_addr (std::vector< AllocationInfo > &t, std::uintptr_t addr)
 
auto & memviz::table ()
 Access the singleton allocation table.
 
std::mutex & memviz::lock ()
 Access the global mutex used to protect the table.
 
void memviz::on_alloc (const void *ptr, std::size_t sz)
 Register a new allocation.
 
void memviz::on_free (const void *ptr)
 Unregister a freed allocation.
 
bool memviz::isLive (const void *ptr)
 Check if a pointer is currently tracked as allocated.
 
void memviz::reportLeaks (std::ostream &os=std::cout)
 Print a summary of all currently live allocations (potential leaks).
 
void memviz::printAllocationLog (std::ostream &os=std::cout)
 Print all currently tracked allocations.
 

Variables

thread_local bool memviz::detail::in_hook = false