mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-6076 Improve allocation counting.
X-SVN-Rev: 23465
This commit is contained in:
parent
ba02cd8038
commit
56c21905a4
1 changed files with 4 additions and 1 deletions
|
@ -573,12 +573,15 @@ static void *U_CALLCONV ctest_libRealloc(const void *context, void *mem, size_t
|
|||
return NULL;
|
||||
}
|
||||
if (mem == NULL) {
|
||||
/* New allocation. */
|
||||
umtx_atomic_inc(&ALLOCATION_COUNT);
|
||||
}
|
||||
return realloc(mem, size);
|
||||
}
|
||||
static void U_CALLCONV ctest_libFree(const void *context, void *mem) {
|
||||
umtx_atomic_dec(&ALLOCATION_COUNT);
|
||||
if (mem != NULL) {
|
||||
umtx_atomic_dec(&ALLOCATION_COUNT);
|
||||
}
|
||||
free(mem);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue