MySQL  8.0.19
Source Code Documentation

Memory statistics. More...

#include <pfs_stat.h>

Public Member Functions

void reset (void)
 
void rebase (void)
 
PFS_memory_stat_deltacount_alloc (size_t size, PFS_memory_stat_delta *delta)
 
PFS_memory_stat_deltacount_realloc (size_t old_size, size_t new_size, PFS_memory_stat_delta *delta)
 
PFS_memory_stat_deltacount_free (size_t size, PFS_memory_stat_delta *delta)
 

Public Attributes

bool m_used
 
size_t m_alloc_count
 
size_t m_free_count
 
size_t m_alloc_size
 
size_t m_free_size
 
size_t m_alloc_count_capacity
 
size_t m_free_count_capacity
 
size_t m_alloc_size_capacity
 
size_t m_free_size_capacity
 

Detailed Description

Memory statistics.

Conceptually, the following statistics are maintained:

  • CURRENT_COUNT_USED,
  • LOW_COUNT_USED,
  • HIGH_COUNT_USED
  • CURRENT_SIZE_USED,
  • LOW_SIZE_USED,
  • HIGH_SIZE_USED Now, the implementation keeps different counters, which are easier (less overhead) to maintain while collecting statistics. Invariants are as follows: CURRENT_COUNT_USED = m_alloc_count - m_free_count LOW_COUNT_USED + m_free_count_capacity = CURRENT_COUNT_USED CURRENT_COUNT_USED + m_alloc_count_capacity = HIGH_COUNT_USED CURRENT_SIZE_USED = m_alloc_size - m_free_size LOW_SIZE_USED + m_free_size_capacity = CURRENT_SIZE_USED CURRENT_SIZE_USED + m_alloc_size_capacity = HIGH_SIZE_USED

Member Function Documentation

◆ count_alloc()

PFS_memory_stat_delta* PFS_memory_safe_stat::count_alloc ( size_t  size,
PFS_memory_stat_delta delta 
)
inline

◆ count_free()

PFS_memory_stat_delta* PFS_memory_safe_stat::count_free ( size_t  size,
PFS_memory_stat_delta delta 
)
inline

◆ count_realloc()

PFS_memory_stat_delta* PFS_memory_safe_stat::count_realloc ( size_t  old_size,
size_t  new_size,
PFS_memory_stat_delta delta 
)
inline

◆ rebase()

void PFS_memory_safe_stat::rebase ( void  )
inline

◆ reset()

void PFS_memory_safe_stat::reset ( void  )
inline

Member Data Documentation

◆ m_alloc_count

size_t PFS_memory_safe_stat::m_alloc_count

◆ m_alloc_count_capacity

size_t PFS_memory_safe_stat::m_alloc_count_capacity

◆ m_alloc_size

size_t PFS_memory_safe_stat::m_alloc_size

◆ m_alloc_size_capacity

size_t PFS_memory_safe_stat::m_alloc_size_capacity

◆ m_free_count

size_t PFS_memory_safe_stat::m_free_count

◆ m_free_count_capacity

size_t PFS_memory_safe_stat::m_free_count_capacity

◆ m_free_size

size_t PFS_memory_safe_stat::m_free_size

◆ m_free_size_capacity

size_t PFS_memory_safe_stat::m_free_size_capacity

◆ m_used

bool PFS_memory_safe_stat::m_used

The documentation for this struct was generated from the following file: