Show allocations increment/decrement logs behind verbose flag

This commit is contained in:
Gustavo Garcia
2025-05-21 13:14:11 +02:00
parent 1adf0213d7
commit facc83e107
+8 -6
View File
@@ -692,12 +692,13 @@ int check_new_allocation_quota(uint8_t *user, int oauth, uint8_t *realm) {
}
#ifndef _MSC_VER
global_allocation_count++;
TURN_LOG_FUNC(TURN_LOG_LEVEL_DEBUG, "Global turn allocation count incremented, now %ld\n", global_allocation_count);
size_t cur_count = ++global_allocation_count;
#else
size_t cur_count = (size_t)InterlockedIncrement((volatile LONG *)&global_allocation_count);
TURN_LOG_FUNC(TURN_LOG_LEVEL_DEBUG, "Global turn allocation count incremented, now %ld\n", cur_count);
#endif
if (turn_params.verbose > TURN_VERBOSE_NONE) {
TURN_LOG_FUNC(TURN_LOG_LEVEL_DEBUG, "Global turn allocation count incremented, now %ld\n", cur_count);
}
return ret;
}
@@ -731,12 +732,13 @@ void release_allocation_quota(uint8_t *user, int oauth, uint8_t *realm) {
log_level = TURN_LOG_LEVEL_INFO;
}
#ifndef _MSC_VER
global_allocation_count--;
TURN_LOG_FUNC(log_level, "Global turn allocation count decremented, now %ld\n", global_allocation_count);
size_t cur_count = --global_allocation_count;
#else
size_t cur_count = (size_t)InterlockedDecrement((volatile LONG *)&global_allocation_count);
TURN_LOG_FUNC(log_level, "Global turn allocation count decremented, now %ld\n", cur_count);
#endif
if (turn_params.verbose > TURN_VERBOSE_NONE) {
TURN_LOG_FUNC(log_level, "Global turn allocation count decremented, now %ld\n", cur_count);
}
}
//////////////////////////////////