66 t_element *
new) __attribute__((deprecated));
struct s_element t_element
Definition data_structure.h:25
struct s_garbage t_garbage
Definition data_structure.h:26
void free_element_gb(t_garbage *garbage, void *ptr)
Free an element in the garbage collector.
Definition garbage_utils.c:84
void print_garbage(t_garbage *garbage)
Print the garbage collector.
Definition garbage_utils.c:117
void ft_garbageadd_front(t_garbage *garbage, t_element *new)
Adds the 'new' element at the start of stack.
Definition garbage_stack.c:41
int ft_garbageclear(t_garbage *data)
Remove all elements from garbage.
Definition garbage_stack.c:85
void add_to_garbage(t_garbage *garbage, void *ptr)
Add a pointer to the garbage list.
Definition garbage.c:51
void ft_garbageadd_back(t_garbage *stack, t_element *new) __attribute__((deprecated))
Adds the 'new' element at the end of stack.
Definition garbage_stack.c:56
t_element * ft_garbagenew(void *ptr)
Allocates and returns the newly created element 'value' is initialised with content 'next' is set to ...
Definition garbage_stack.c:23
void free_garbage(t_garbage *garbage)
Free the garbage.
Definition garbage.c:72
void garbage_init(t_garbage *garbage)
Get the garbage object.
Definition garbage.c:38
void * malloc_gb(t_garbage *garbage, size_t size)
Replace the original malloc by storing the created adresses into a garbage to remove them afterwards.
Definition garbage.c:86
char * ft_strdup_gb(t_garbage *garbage, const char *source)
Create a copy of source into a new pointer NEEDS to be freed.
Definition garbage_utils.c:30
Basic node for an element of a linked list.
Definition garbage.h:26
void * ptr
Definition garbage.h:27
void * next
Definition garbage.h:28
Head of the linked list.
Definition garbage.h:36
t_element * head
Definition garbage.h:38
size_t n_elements
Definition garbage.h:37