mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
[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
This commit is contained in:
parent
cfebabfdfa
commit
44b5e6d620
1 changed files with 9 additions and 7 deletions
|
@ -77,13 +77,15 @@ toku_strdup(const char *s) {
|
|||
|
||||
void
|
||||
toku_free(void *p) {
|
||||
size_t used = p ? malloc_usable_size(p) : 0;
|
||||
__sync_add_and_fetch(&status.free_count, 1L);
|
||||
__sync_add_and_fetch(&status.freed, used);
|
||||
if (t_free)
|
||||
t_free(p);
|
||||
else
|
||||
os_free(p);
|
||||
if (p) {
|
||||
size_t used = malloc_usable_size(p);
|
||||
__sync_add_and_fetch(&status.free_count, 1L);
|
||||
__sync_add_and_fetch(&status.freed, used);
|
||||
if (t_free)
|
||||
t_free(p);
|
||||
else
|
||||
os_free(p);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Reference in a new issue