MALOC  0.1
vmem.h
Go to the documentation of this file.
1 
40 #ifndef _VMEM_H_
41 #define _VMEM_H_
42 
43 #include <maloc/maloc_base.h>
44 
45 /*
46  * ***************************************************************************
47  * Class Vmem: Parameters and datatypes
48  * ***************************************************************************
49  */
50 
51 
57 struct sVmem {
58 
59  char name[VMAX_ARGLEN];
61  size_t mallocBytes;
62  size_t freeBytes;
63  size_t highWater;
64  size_t mallocAreas;
66 };
67 
73 typedef struct sVmem Vmem;
74 
75 /*
76  * ***************************************************************************
77  * Class Vmem: Inlineable methods (vmem.c)
78  * ***************************************************************************
79  */
80 
81 #if !defined(VINLINE_MALOC)
82 #else /* if defined(VINLINE_MALOC) */
83 #endif /* if !defined(VINLINE_MALOC) */
84 
85 /*
86  * ***************************************************************************
87  * Class Vmem: Non-Inlineable methods (vmem.c)
88  * ***************************************************************************
89  */
90 
98 size_t Vmem_bytesTotal(void);
99 
108 
116 size_t Vmem_freeBytesTotal(void);
117 
125 size_t Vmem_highWaterTotal(void);
126 
135 
143 void Vmem_printTotal(void);
144 
154 
163 void Vmem_dtor(Vmem **thee);
164 
175 void *Vmem_malloc(Vmem *thee, size_t num, size_t size);
176 
188 void Vmem_free(Vmem *thee, size_t num, size_t size, void **ram);
189 
202 void *Vmem_realloc(Vmem *thee, size_t num, size_t size, void **ram,
203  size_t newNum);
204 
213 size_t Vmem_bytes(Vmem *thee);
214 
223 size_t Vmem_mallocBytes(Vmem *thee);
224 
233 size_t Vmem_freeBytes(Vmem *thee);
234 
243 size_t Vmem_highWater(Vmem *thee);
244 
253 size_t Vmem_mallocAreas(Vmem *thee);
254 
263 void Vmem_print(Vmem *thee);
264 
265 #endif /* _VMEM_H_ */
266 
The base (or foundation) header for MALOC.
#define VMAX_ARGLEN
Global constant.
Definition: maloc_base.h:227
void Vmem_free(Vmem *thee, size_t num, size_t size, void **ram)
A safe logged version of free.
size_t Vmem_mallocAreas(Vmem *thee)
Return total number of individual active malloc areas.
size_t Vmem_mallocAreasTotal(void)
Return total of all active Vmem malloc areas by groups.
void Vmem_printTotal(void)
Print current memory statistics for all Vmem malloc/free areas.
Vmem * Vmem_ctor(char *name)
Construct the dynamic memory allocation logging object.
size_t Vmem_freeBytes(Vmem *thee)
Return total of all frees performed by Vmem object.
void * Vmem_malloc(Vmem *thee, size_t num, size_t size)
A safe logged version of malloc.
size_t Vmem_highWater(Vmem *thee)
Return high-water malloc bytemark hit by Vmem object.
size_t Vmem_bytesTotal(void)
Return total of all active Vmem malloc areas (current footprint)
size_t Vmem_freeBytesTotal(void)
Return total of all Vmem free calls.
void * Vmem_realloc(Vmem *thee, size_t num, size_t size, void **ram, size_t newNum)
A safe logged version of realloc (usually a bad idea to use this)
size_t Vmem_highWaterTotal(void)
Return the high-water byte mark (largest footprint)
size_t Vmem_bytes(Vmem *thee)
Return total of all ACTIVE malloc areas used by Vmem object.
void Vmem_print(Vmem *thee)
Print current memory stats associated with this Vmem object.
void Vmem_dtor(Vmem **thee)
Destruct the dynamic memory allocation logging object.
size_t Vmem_mallocBytes(Vmem *thee)
Return total of all mallocs performed by Vmem object.
size_t Vmem_mallocBytesTotal(void)
Return total of all Vmem malloc allocations.
Contains public data members for Vmem class.
Definition: vmem.h:57
char name[VMAX_ARGLEN]
Definition: vmem.h:59
size_t freeBytes
Definition: vmem.h:62
size_t mallocBytes
Definition: vmem.h:61
size_t mallocAreas
Definition: vmem.h:64
size_t highWater
Definition: vmem.h:63