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