fix realloc size detection when new size is larger than current chunk max size, add pthread mutex to make the functions thread safe

This commit is contained in:
2024-12-05 18:59:07 +01:00
parent a9ad4492cc
commit 039d29f0d7
6 changed files with 52 additions and 30 deletions

5
main.c
View File

@ -5,6 +5,11 @@ int main(void)
{
void *ptr;
printf("%zu\n", SMALL_CHUNK_SIZE);
ptr = malloc(1203);
show_alloc_mem();
ptr = realloc(ptr, 12045);
show_alloc_mem();
free(ptr);
show_alloc_mem();
}