You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
tideways_realloc() does not correctly collect the allocation stats when wrapping the realloc() function.
It currently assumes that:
a new allocation is always done, which is not true.
a free (of the old memory) is always done, which is not true. Furthermore realloc can be called with NULL as first argument in order to perform an initial allocation.
the total allocated memory is always incremented by the size given as 2nd argument, which is not true.
From the manpage man 3 realloc:
The realloc() function changes the size of the memory block pointed to by ptr to size bytes. The contents will be unchanged in the range from the start of the region up to the minimum of the
old and new sizes. If the new size is larger than the old size, the added memory will not be initialized. If ptr is NULL, then the call is equivalent to malloc(size), for all values of
size; if size is equal to zero, and ptr is not NULL, then the call is equivalent to free(ptr). Unless ptr is NULL, it must have been returned by an earlier call to malloc(), calloc(), or
realloc(). If the area pointed to was moved, a free(ptr) is done.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
tideways_realloc() does not correctly collect the allocation stats when wrapping the
realloc()
function.It currently assumes that:
From the manpage
man 3 realloc
:The text was updated successfully, but these errors were encountered: