7 #define LWIP_TAG 'PIwl'
11 malloc(mem_size_t size
)
13 return ExAllocatePoolWithTag(NonPagedPool
, size
, LWIP_TAG
);
17 calloc(mem_size_t count
, mem_size_t size
)
19 void *mem
= malloc(count
* size
);
21 if (!mem
) return NULL
;
23 RtlZeroMemory(mem
, count
* size
);
31 ExFreePoolWithTag(mem
, LWIP_TAG
);
34 /* This is only used to trim in lwIP */
36 realloc(void *mem
, size_t size
)
40 /* realloc() with a NULL mem pointer acts like a call to malloc() */
45 /* realloc() with a size 0 acts like a call to free() */
51 /* Allocate the new buffer first */
52 new_mem
= malloc(size
);
53 if (new_mem
== NULL
) {
54 /* The old buffer is still intact */
58 /* Copy the data over */
59 RtlCopyMemory(new_mem
, mem
, size
);
61 /* Deallocate the old buffer */
64 /* Return the newly allocated block */