-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmalloc.c
27 lines (22 loc) · 1.13 KB
/
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
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* malloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ffloris <ffloris@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/03 13:39:16 by ffloris #+# #+# */
/* Updated: 2018/11/14 17:56:44 by ffloris ### ########.fr */
/* */
/* ************************************************************************** */
#include "malloc.h"
t_zones g_zones = {{'\0'}, NULL, NULL, NULL};
pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER;
void *malloc(size_t size)
{
void *ptr;
pthread_mutex_lock(&g_mutex);
ptr = allocate(size);
pthread_mutex_unlock(&g_mutex);
return (ptr);
}