fixed deadlock in ft_free
This commit is contained in:
parent
6bc3783b67
commit
4de08df981
1 changed files with 7 additions and 10 deletions
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* ft_free.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
|
||||
/* By: thrieg < thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/19 15:44:05 by thrieg #+# #+# */
|
||||
/* Updated: 2025/12/13 06:52:01 by thrieg ### ########.fr */
|
||||
/* Updated: 2025/12/15 15:54:45 by thrieg ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -89,17 +89,14 @@ void free(void *ptr)
|
|||
pthread_mutex_unlock(&g_mut);
|
||||
return;
|
||||
}
|
||||
else if (header->zone->type == E_SMALL)
|
||||
else if (header->zone->type == E_SMALL || header->zone->type == E_TINY)
|
||||
{
|
||||
header->occupied = false;
|
||||
if (defrag_zone(header->zone))
|
||||
return; //zone munmaped, avoid all other logic on this memory
|
||||
{
|
||||
pthread_mutex_unlock(&g_mut);
|
||||
return; // zone munmaped, avoid all other logic on this memory
|
||||
}
|
||||
else if (header->zone->type == E_TINY)
|
||||
{
|
||||
header->occupied = false;
|
||||
if (defrag_zone(header->zone))
|
||||
return; //zone munmaped, avoid all other logic on this memory
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue