DVX_GUI/core/dvxMem.h

28 lines
898 B
C

// dvxMem.h -- Per-app memory tracking API for DVX
//
// Declares the tracked allocation functions. DXE code does NOT need
// to include this header for tracking to work -- the DXE export table
// maps malloc/free/calloc/realloc/strdup to these wrappers transparently.
//
// This header is provided for code that needs to call the tracking
// functions by name (e.g. dvxMemGetAppUsage in the Task Manager) or
// for the dvxMemAppIdPtr declaration.
#ifndef DVX_MEM_H
#define DVX_MEM_H
#include <stdint.h>
#include <stdlib.h>
extern int32_t *dvxMemAppIdPtr;
void *dvxMalloc(size_t size);
void *dvxCalloc(size_t nmemb, size_t size);
void *dvxRealloc(void *ptr, size_t size);
void dvxFree(void *ptr);
char *dvxStrdup(const char *s);
void dvxMemSnapshotLoad(int32_t appId);
uint32_t dvxMemGetAppUsage(int32_t appId);
void dvxMemResetApp(int32_t appId);
#endif // DVX_MEM_H