mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-08 20:38:41 +03:00
Enforce mi_stat wrapper for performance and consistency
Statistics wrapper macros, mi_stat_{increase,counter_increase} are defined as no-op when MI_STAT equals to 0 (no runtime statistics). However, even MI_STAT is set to 0, internal functions such as _mi_stat_increase are invoked unexpectedly. This patch enforces the use of mi_stat wrapper macros and MI_STAT.
This commit is contained in:
parent
e2b4127a16
commit
e5f37eb806
6 changed files with 42 additions and 30 deletions
|
@ -341,7 +341,7 @@ void _mi_stat_increase(mi_stat_count_t* stat, size_t amount);
|
|||
void _mi_stat_decrease(mi_stat_count_t* stat, size_t amount);
|
||||
void _mi_stat_counter_increase(mi_stat_counter_t* stat, size_t amount);
|
||||
|
||||
#if (MI_STAT)
|
||||
#if MI_STAT>0
|
||||
#define mi_stat_increase(stat,amount) _mi_stat_increase( &(stat), amount)
|
||||
#define mi_stat_decrease(stat,amount) _mi_stat_decrease( &(stat), amount)
|
||||
#define mi_stat_counter_increase(stat,amount) _mi_stat_counter_increase( &(stat), amount)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue