Skip to content

Mogball/wlib-malloc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wlib-malloc

malloc and free replacements for WLib using wlib-tlsf.

Install

wio pac add wlib-malloc

Usage

mem::meminit must be called at program start with a user-provided memory pool for the global allocator instance to manage.

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<char *>(mem::alloc(128));
    // ...
    mem::free(ptr);
}

About

Memory allocator library for WLib

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • C++ 58.3%
  • Shell 24.5%
  • CMake 15.3%
  • C 1.9%