Clapkit
Loading...
Searching...
No Matches
ckMemory.cpp File Reference
#include "ckMemory.h"
#include "ckUtils.h"
#include <algorithm>
#include <string.h>
#include <vector>

Classes

struct  CKAllocdMemory
 

Functions

CKAllocdMemory __CKReportAllocation (const char *func, int line, const char *_file, size_t size, bool viaNew)
 
void __CKReportDeallocation (void *ptr, const char *func, int line, const char *_file, bool viaDelete)
 
void * __CKNew (const char *func, int line, const char *file, size_t size)
 
void __CKDelete (void *ptr, const char *func, int line, const char *file)
 
void * __CKMalloc (const char *func, int line, const char *file, size_t size)
 
void __CKFree (const char *func, int line, const char *file, void *ptr)
 
void CKMemoryUsage (size_t *_totalAllocd, size_t *_totalFreed, int *_numOfPtrs)
 
void CKMemoryDumpLeaks ()
 
bool __CKSafeCopyString (char **dest, const char *src, const char *func, int line, const char *file)
 

Function Documentation

◆ __CKDelete()

void __CKDelete ( void *  ptr,
const char *  func,
int  line,
const char *  file 
)

Wrapper for delete used to find potential leaks.

◆ __CKFree()

void __CKFree ( const char *  func,
int  line,
const char *  file,
void *  ptr 
)

◆ __CKMalloc()

void * __CKMalloc ( const char *  func,
int  line,
const char *  file,
size_t  size 
)

Wrapper for malloc used to find potential leaks.

◆ __CKNew()

void * __CKNew ( const char *  func,
int  line,
const char *  file,
size_t  size 
)

Wrapper for new used to find potential leaks.

◆ __CKReportAllocation()

CKAllocdMemory __CKReportAllocation ( const char *  func,
int  line,
const char *  _file,
size_t  size,
bool  viaNew 
)

◆ __CKReportDeallocation()

void __CKReportDeallocation ( void *  ptr,
const char *  func,
int  line,
const char *  _file,
bool  viaDelete 
)

◆ __CKSafeCopyString()

bool __CKSafeCopyString ( char **  dest,
const char *  src,
const char *  func,
int  line,
const char *  file 
)

◆ CKMemoryDumpLeaks()

void CKMemoryDumpLeaks ( )

(Try to) print all the leaks to the console.

◆ CKMemoryUsage()

void CKMemoryUsage ( size_t *  _totalAllocd,
size_t *  _totalFreed,
int *  _numOfPtrs 
)

Return the stats about memory usage.