vmem.h
Go to the documentation of this file.
#ifndef _VMEM_H_
#define _VMEM_H_
#include <maloc/maloc_base.h>
/*
* ***************************************************************************
* Class Vmem: Parameters and datatypes
* ***************************************************************************
*/
struct sVmem {
char name[VMAX_ARGLEN];
size_t mallocBytes;
size_t freeBytes;
size_t highWater;
size_t mallocAreas;
};
typedef struct sVmem Vmem;
/*
* ***************************************************************************
* Class Vmem: Inlineable methods (vmem.c)
* ***************************************************************************
*/
#if !defined(VINLINE_MALOC)
#else /* if defined(VINLINE_MALOC) */
#endif /* if !defined(VINLINE_MALOC) */
/*
* ***************************************************************************
* Class Vmem: Non-Inlineable methods (vmem.c)
* ***************************************************************************
*/
size_t Vmem_bytesTotal(void);
size_t Vmem_mallocBytesTotal(void);
size_t Vmem_freeBytesTotal(void);
size_t Vmem_highWaterTotal(void);
size_t Vmem_mallocAreasTotal(void);
void Vmem_printTotal(void);
Vmem* Vmem_ctor(char *name);
void Vmem_dtor(Vmem **thee);
void *Vmem_malloc(Vmem *thee, size_t num, size_t size);
void Vmem_free(Vmem *thee, size_t num, size_t size, void **ram);
void *Vmem_realloc(Vmem *thee, size_t num, size_t size, void **ram,
size_t newNum);
size_t Vmem_bytes(Vmem *thee);
size_t Vmem_mallocBytes(Vmem *thee);
size_t Vmem_freeBytes(Vmem *thee);
size_t Vmem_highWater(Vmem *thee);
size_t Vmem_mallocAreas(Vmem *thee);
void Vmem_print(Vmem *thee);
#endif /* _VMEM_H_ */
maloc_base.h
The base (or foundation) header for MALOC.
VMAX_ARGLEN
#define VMAX_ARGLEN
Global constant.
Definition maloc_base.h:227
Vmem_free
void Vmem_free(Vmem *thee, size_t num, size_t size, void **ram)
A safe logged version of free.
Vmem_mallocAreas
size_t Vmem_mallocAreas(Vmem *thee)
Return total number of individual active malloc areas.
Vmem_mallocAreasTotal
size_t Vmem_mallocAreasTotal(void)
Return total of all active Vmem malloc areas by groups.
Vmem_printTotal
void Vmem_printTotal(void)
Print current memory statistics for all Vmem malloc/free areas.
Vmem
struct sVmem Vmem
Declaration of the Vmem class as the Vmem structure.
Definition vmem.h:73
Vmem_freeBytes
size_t Vmem_freeBytes(Vmem *thee)
Return total of all frees performed by Vmem object.
Vmem_highWater
size_t Vmem_highWater(Vmem *thee)
Return high-water malloc bytemark hit by Vmem object.
Vmem_malloc
void * Vmem_malloc(Vmem *thee, size_t num, size_t size)
A safe logged version of malloc.
Vmem_bytesTotal
size_t Vmem_bytesTotal(void)
Return total of all active Vmem malloc areas (current footprint).
Vmem_freeBytesTotal
size_t Vmem_freeBytesTotal(void)
Return total of all Vmem free calls.
Vmem_realloc
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).
Vmem_ctor
Vmem * Vmem_ctor(char *name)
Construct the dynamic memory allocation logging object.
Vmem_highWaterTotal
size_t Vmem_highWaterTotal(void)
Return the high-water byte mark (largest footprint).
Vmem_bytes
size_t Vmem_bytes(Vmem *thee)
Return total of all ACTIVE malloc areas used by Vmem object.
Vmem_print
void Vmem_print(Vmem *thee)
Print current memory stats associated with this Vmem object.
Vmem_dtor
void Vmem_dtor(Vmem **thee)
Destruct the dynamic memory allocation logging object.
Vmem_mallocBytes
size_t Vmem_mallocBytes(Vmem *thee)
Return total of all mallocs performed by Vmem object.
Vmem_mallocBytesTotal
size_t Vmem_mallocBytesTotal(void)
Return total of all Vmem malloc allocations.
sVmem
Contains public data members for Vmem class.
Definition vmem.h:57
sVmem::name
char name[VMAX_ARGLEN]
Definition vmem.h:59
sVmem::freeBytes
size_t freeBytes
Definition vmem.h:62
sVmem::mallocBytes
size_t mallocBytes
Definition vmem.h:61
sVmem::mallocAreas
size_t mallocAreas
Definition vmem.h:64
sVmem::highWater
size_t highWater
Definition vmem.h:63