UNPKG

wlib-malloc

Version:

Replacements for malloc and free

35 lines 1.34 kB
{ "name": "wlib-malloc", "description": "Replacements for malloc and free", "keywords": [ "wio", "c", "c++", "memory", "embedded", "waterloop" ], "readme": "# wlib-malloc\n\n`malloc` and `free` replacements for WLib using `wlib-tlsf`.\n\n### Install\n\n```bash\nwio pac add wlib-malloc\n```\n\n### Usage\n\n`mem::meminit` must be called at program start with a user-provided memory pool\nfor the global allocator instance to manage.\n\n```c++\nstatic byte s_pool[POOL_SIZE];\n\nusing namespace wlp;\n\nint main(int argc, char *argv[]) {\n mem::init(s_pool, POOL_SIZE);\n \n char *ptr = static_cast\u003cchar *\u003e(mem::alloc(128));\n // ...\n mem::free(ptr);\n}\n\n```\n", "readmeFile": "README.md", "version": "1.0.4", "main": ".wio.js", "dist": { "integrity": "", "shasum": "", "tarball": "", "fileCount": 0, "unpackedSize": 0, "npm-signature": "" }, "scripts": null, "dependencies": { "wlib-tlsf": "1.0.5" }, "maintainers": null, "contributors": null, "bugs": "", "author": "Jeff Niu \u003cjeffniu22@gmail.com\u003e (https://github.com/mogball)", "license": "", "homepage": "", "repository": "https://github.com/wloop/wlib-malloc.git" }