-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_malloc.c
26 lines (23 loc) · 1.06 KB
/
ft_malloc.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_malloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ylagtab <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/15 19:06:41 by ylagtab #+# #+# */
/* Updated: 2021/01/23 10:08:11 by ylagtab ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_malloc(size_t size)
{
void *ptr;
ptr = malloc(size);
if (ptr == NULL && EXIT_ON_ALLOC_FAIL)
{
ft_printf(2, "Allocation Error!\n");
exit(1);
}
return (ptr);
}