Commit 6d24ebc1 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:3825] #3825 Do not count free() operations when passed a NULL.

git-svn-id: file:///svn/toku/tokudb@33950 c7de825b-a66e-492c-adef-691d508d4ae1
parent 50f66714
...@@ -77,13 +77,15 @@ toku_strdup(const char *s) { ...@@ -77,13 +77,15 @@ toku_strdup(const char *s) {
void void
toku_free(void *p) { toku_free(void *p) {
size_t used = p ? malloc_usable_size(p) : 0; if (p) {
size_t used = malloc_usable_size(p);
__sync_add_and_fetch(&status.free_count, 1L); __sync_add_and_fetch(&status.free_count, 1L);
__sync_add_and_fetch(&status.freed, used); __sync_add_and_fetch(&status.freed, used);
if (t_free) if (t_free)
t_free(p); t_free(p);
else else
os_free(p); os_free(p);
}
} }
void void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment