Skip to content

Commit

Permalink
Changed memset to libft function ft_memset
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsunghao-C committed Aug 26, 2024
1 parent 6fd2f92 commit a2ee0cf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions srcs/garbage_collector/gc_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

int gc_init(t_gc_container *gc, pthread_t *gc_thread)
{
memset(gc->garbage, 0, MAX_GARBAGE * sizeof(void *));
memset(gc->garbage_type, 0, MAX_GARBAGE * sizeof(t_type));
memset(gc->garbage_size, 0, MAX_GARBAGE * sizeof(size_t));
ft_memset(gc->garbage, 0, MAX_GARBAGE * sizeof(void *));
ft_memset(gc->garbage_type, 0, MAX_GARBAGE * sizeof(t_type));
ft_memset(gc->garbage_size, 0, MAX_GARBAGE * sizeof(size_t));
gc->last_pos = 0;
gc->run_status = RUN;
if (pthread_mutex_init(&gc->garbage_lock, NULL) != 0)
Expand All @@ -37,7 +37,7 @@ void gc_destroy(t_gc_container *gc, pthread_t *gc_thread)
pthread_join(*gc_thread, NULL);
gc_thread = NULL;
pthread_mutex_destroy(&gc->garbage_lock);
memset(gc->garbage, 0, MAX_GARBAGE * sizeof(void *));
memset(gc->garbage_type, 0, MAX_GARBAGE * sizeof(t_type));
memset(gc->garbage_size, 0, MAX_GARBAGE * sizeof(size_t));
ft_memset(gc->garbage, 0, MAX_GARBAGE * sizeof(void *));
ft_memset(gc->garbage_type, 0, MAX_GARBAGE * sizeof(t_type));
ft_memset(gc->garbage_size, 0, MAX_GARBAGE * sizeof(size_t));
}

0 comments on commit a2ee0cf

Please sign in to comment.