define pst_alloc & pst_free macro to use global allocator

This commit is contained in:
2020-02-01 17:57:43 +04:00
parent e27f0c5c18
commit 7c13dfa9e1
8 changed files with 50 additions and 46 deletions
-12
View File
@@ -63,15 +63,3 @@ void pst_alloc_fini(pst_allocator* alloc)
alloc->size = 0;
}
}
char* pst_dup(pst_allocator* alloc, const char* str)
{
pst_assert(alloc && str);
uint32_t len = strlen(str);
char* dst = (char*)alloc->alloc(len + 1);
memcpy(dst, str, len);
dst[len] = 0;
return dst;
}