Repository navigation
Expand file tree
/
Copy pathft_alloc.h
More file actions
41 lines (35 loc) · 1.36 KB
/
Copy pathft_alloc.h
File metadata and controls
41 lines (35 loc) · 1.36 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_alloc.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nbenyahy <nbenyahy@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/28 07:28:54 by nbenyahy #+# #+# */
/* Updated: 2024/07/28 12:01:01 by nbenyahy ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_ALLOC_H
# define FT_ALLOC_H
# include <stddef.h>
# include <stdlib.h>
# include <unistd.h>
enum e_alloc_mode
{
MALLOC,
CALLOC,
REALLOC,
FREE_ALL,
FREE_PTR,
};
typedef struct s_address
{
void *address;
size_t size;
struct s_address *next;
struct s_address *prev;
} t_address;
void ft_alloc_add_back(t_address **lst, t_address *new_node);
t_address *ft_alloc_new_node(void *ptr, size_t size);
void *ft_alloc(size_t size, void *ptr, char c);
#endif