A virtual currency betting bot for Twitch chat. https://ddark.net/better
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 lines
760 B

#ifndef BETTER_ALLOC_H
#define BETTER_ALLOC_H
#include <cstdint>
struct AllocHeader
{
size_t size;
char* strid;
};
struct AllocSum
{
const char* strid;
size_t size;
int count;
};
#if BETTER_DEBUG
#define BETTER_ALLOC(size, strid) tracked_malloc((size), (strid))
#define BETTER_FREE(size) tracked_free((size))
#define BETTER_REALLOC(ptr, size, strid) tracked_realloc((ptr), (size), (strid))
void* tracked_malloc(size_t size, const char* strid);
void tracked_free(void* ptr);
void* tracked_realloc(void* ptr, size_t size, const char* strid);
#else
#define BETTER_ALLOC(size, strid) malloc((size))
#define BETTER_FREE(size) free((size))
#define BETTER_REALLOC(ptr, size, strid) realloc((ptr), (size))
#endif
#endif // BETTER_ALLOC_H