* Sync the recent cmake branch changes.
[reactos.git] / lib / drivers / lwip / src / rosmem.c
1
2 #include "lwip/opt.h"
3
4 #include "lwip/def.h"
5 #include "lwip/mem.h"
6
7 #define LWIP_TAG 'PIwl'
8
9 void *
10 malloc(mem_size_t size)
11 {
12 return ExAllocatePoolWithTag(NonPagedPool, size, LWIP_TAG);
13 }
14
15 void *
16 calloc(mem_size_t count, mem_size_t size)
17 {
18 void *mem = malloc(count * size);
19
20 if (!mem) return NULL;
21
22 RtlZeroMemory(mem, count * size);
23
24 return mem;
25 }
26
27 void
28 free(void *mem)
29 {
30 ExFreePoolWithTag(mem, LWIP_TAG);
31 }
32
33 void *
34 realloc(void *mem, size_t size)
35 {
36 free(mem);
37 return malloc(size);
38 }