-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathft_alloc.h
48 lines (38 loc) · 1.48 KB
/
ft_alloc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_alloc.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: escura <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/04 14:06:08 by escura #+# #+# */
/* Updated: 2024/05/08 15:20:22 by escura ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_ALLOC_H
# define FT_ALLOC_H
# ifndef DEBUG
# define DEBUG 0
# endif
# include <stdio.h>
# include <stdlib.h>
# include <stdbool.h>
typedef struct t_allocs
{
void *ptr;
struct t_allocs *next;
} t_allocs;
/* init */
bool ft_alloc_init(void);
/* allocations */
void *ft_calloc(size_t count, size_t size);
void *ft_malloc(size_t size);
/* utils */
t_allocs *ft_allocs(t_allocs *lst);
void add_allocnode(t_allocs **lst, t_allocs *nnew);
t_allocs *create_alloc(void *ptr);
int ft_allocsize(void);
/* destructors */
void ft_free(void *ptr);
void ft_destructor(void);
#endif