added comments

This commit is contained in:
Thomas Rieg 2025-12-08 16:02:47 +01:00
parent 44b6a96057
commit 99697d949e
3 changed files with 5 additions and 5 deletions

View file

@ -6,7 +6,7 @@
/* By: thrieg < thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/28 17:23:45 by thrieg #+# #+# */
/* Updated: 2025/12/08 14:22:46 by thrieg ### ########.fr */
/* Updated: 2025/12/08 15:52:17 by thrieg ### ########.fr */
/* */
/* ************************************************************************** */
@ -36,7 +36,7 @@ int main(void)
free(c);
write(1, "\n\n\n\n\nafter free: \n\n\n\n\n", sizeof("\n\n\n\n\nafter free: \n\n\n\n\n") - 1);
show_alloc_mem_ex(false);
show_alloc_mem_ex(true);
a = malloc(20);
b = malloc(1000);

View file

@ -6,7 +6,7 @@
/* By: thrieg < thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/17 15:02:55 by thrieg #+# #+# */
/* Updated: 2025/12/08 15:37:27 by thrieg ### ########.fr */
/* Updated: 2025/12/08 16:02:22 by thrieg ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: thrieg < thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/25 11:47:23 by thrieg #+# #+# */
/* Updated: 2025/12/08 15:37:18 by thrieg ### ########.fr */
/* Updated: 2025/12/08 16:02:18 by thrieg ### ########.fr */
/* */
/* ************************************************************************** */
@ -102,7 +102,7 @@ void *realloc(void *ptr, size_t size)
{
header->size = available_space;
}
pthread_mutex_unlock(&g_mut);
pthread_mutex_unlock(&g_mut); // doesn't need to stay locked because the user is not supposed to free or realloc this ptr or change its content before this realloc returns
if (g_state.patern)
ft_memset((char *)ptr + original_space, g_state.patern, header->size - original_space); // should I use original_size to only perturb the actually requested bytes instead of the bytes I allocate?
return (ptr);