Replacements for malloc and free
npm install wlib-mallocmalloc and free replacements for WLib using wlib-tlsf.
``bash`
wio pac add wlib-malloc
mem::meminit must be called at program start with a user-provided memory pool
for the global allocator instance to manage.
`c++
static byte s_pool[POOL_SIZE];
using namespace wlp;
int main(int argc, char *argv[]) {
mem::init(s_pool, POOL_SIZE);
char ptr = static_cast
// ...
mem::free(ptr);
}
``