improve mem

This commit is contained in:
lixianjing 2020-06-15 18:56:00 +08:00
parent a032099caa
commit 2ba7d1485e

View File

@ -281,6 +281,7 @@ mem_stat_t tk_mem_stat() {
return st; return st;
} }
#ifdef WITH_SDL
/*export std malloc*/ /*export std malloc*/
void* calloc(size_t count, size_t size) { void* calloc(size_t count, size_t size) {
return tk_calloc_impl(count, size); return tk_calloc_impl(count, size);
@ -297,6 +298,8 @@ void* malloc(size_t size) {
void* realloc(void* ptr, size_t size) { void* realloc(void* ptr, size_t size) {
return tk_realloc_impl(ptr, size); return tk_realloc_impl(ptr, size);
} }
#endif/*WITH_SDL*/
#endif /*HAS_STD_MALLOC*/ #endif /*HAS_STD_MALLOC*/
static void* tk_calloc_impl(uint32_t nmemb, uint32_t s) { static void* tk_calloc_impl(uint32_t nmemb, uint32_t s) {