memory.c
Go to the documentation of this file.
1 
11 #include "memory.h"
12 #include <stdlib.h>
13 
15 {
16  if (0 == size)
17  {
18  return NULL;
19  }
20 
21  return malloc(size);
22 }
23 
25 {
26  if ((0 == count) || (0 == bytes))
27  {
28  return NULL;
29  }
30 
31  return calloc(count, bytes);
32 }
33 
34 void *mcl_memory_realloc(void *p, mcl_size_t bytes)
35 {
36  if (0 == bytes)
37  {
38  free(p);
39  return NULL;
40  }
41 
42  return realloc(p, bytes);
43 }
44 
45 void mcl_memory_free(void *p)
46 {
47  free(p);
48 }
size_t mcl_size_t
Memory module header file.
void * mcl_memory_realloc(void *p, mcl_size_t bytes)
Definition: memory.c:34
void * mcl_memory_calloc(mcl_size_t count, mcl_size_t bytes)
Definition: memory.c:24
void mcl_memory_free(void *p)
Definition: memory.c:45
void * mcl_memory_malloc(mcl_size_t size)
Definition: memory.c:14