提交 a899606d 编写于 作者: J jp9000

Merge branch 'master' of https://github.com/jp9000/obs-studio

......@@ -59,7 +59,8 @@ libobs_la_SOURCES += util/platform-windows.c obs-windows.c
endif
if OS_OSX
libobs_la_SOURCES += util/platform-cocoa.c obs-cocoa.c
libobs_la_SOURCES += util/platform-cocoa.m obs-cocoa.c
libobs_la_OBJCFLAGS = -fobjc-arc
endif
if OS_NIX
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -57,10 +57,14 @@ typedef long off_t;
typedef int64_t off64_t;
#endif /* __off_t_defined */
#define SIZE_T_FORMAT "%u"
#else
#include <stdint.h>
#include <stdbool.h>
#include <sys/types.h>
#define SIZE_T_FORMAT "%zu"
#endif /* _MSC_VER */
......@@ -31,7 +31,7 @@ IMPLEMENT_APP(OBSApp);
OBSAppBase::~OBSAppBase()
{
blog(LOG_INFO, "Number of memory leaks: %zu", 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)
......
......@@ -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());
}
/* --------------------------------------------------- */
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册