Whoops, overallocated.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4194 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-02-20 02:42:11 +00:00
parent 961109635b
commit b8b694864e

View File

@ -340,7 +340,7 @@ static void* _tf_uv_calloc(size_t nmemb, size_t size)
count = tf_util_backtrace(buffer, sizeof(buffer) / sizeof(*buffer)); count = tf_util_backtrace(buffer, sizeof(buffer) / sizeof(*buffer));
overhead += sizeof(tf_mem_node_t) + sizeof(void*) * count; overhead += sizeof(tf_mem_node_t) + sizeof(void*) * count;
} }
void* ptr = calloc(1, nmemb * rounded_up_size + overhead); void* ptr = calloc(1, rounded_up_size + overhead);
if (ptr) if (ptr)
{ {
__atomic_add_fetch(&s_uv_malloc_size, total_size, __ATOMIC_RELAXED); __atomic_add_fetch(&s_uv_malloc_size, total_size, __ATOMIC_RELAXED);