0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

changed allocation counter to uint64_t

also avoids format string confusion for bnum_allocs
This commit is contained in:
Palana 2013-12-07 17:39:43 +01:00
parent 968f9c03bd
commit e6017ec1ba
5 changed files with 6 additions and 6 deletions

View File

@ -90,7 +90,7 @@ static void a_free(void *ptr)
}
static struct base_allocator alloc = {a_malloc, a_realloc, a_free};
static size_t num_allocs = 0;
static uint64_t num_allocs = 0;
void base_set_allocator(struct base_allocator *defs)
{
@ -132,7 +132,7 @@ void bfree(void *ptr)
alloc.free(ptr);
}
size_t bnum_allocs(void)
uint64_t bnum_allocs(void)
{
return num_allocs;
}

View File

@ -44,7 +44,7 @@ EXPORT void *bmalloc(size_t size);
EXPORT void *brealloc(void *ptr, size_t size);
EXPORT void bfree(void *ptr);
EXPORT size_t bnum_allocs(void);
EXPORT uint64_t bnum_allocs(void);
EXPORT void *bmemdup(const void *ptr, size_t size);

View File

@ -31,7 +31,7 @@ IMPLEMENT_APP(OBSApp);
OBSAppBase::~OBSAppBase()
{
blog(LOG_INFO, "Number of memory leaks: " SIZE_T_FORMAT, bnum_allocs());
blog(LOG_INFO, "Number of memory leaks: %llu", bnum_allocs());
}
static void do_log(enum log_type type, const char *msg, va_list args)

View File

@ -179,7 +179,7 @@ static void test()
obs_shutdown();
blog(LOG_INFO, "Number of memory leaks: %zu", bnum_allocs());
blog(LOG_INFO, "Number of memory leaks: %llu", bnum_allocs());
}
/* --------------------------------------------------- */

View File

@ -189,7 +189,7 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine,
obs_shutdown();
blog(LOG_INFO, "Number of memory leaks: %u", bnum_allocs());
blog(LOG_INFO, "Number of memory leaks: %llu", bnum_allocs());
DestroyWindow(hwnd);
return 0;