Introduce libc/mem/tinymalloc.inc

This allocator shaves ~20kb off single-threaded tool programs and is
slightly faster than proper malloc for simple non-demanding programs
This commit is contained in:
Justine Tunney 2024-05-07 00:37:41 -07:00
parent 3bf95ae7ec
commit a6ecbb747d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
17 changed files with 201 additions and 37 deletions

View file

@ -158,6 +158,8 @@ static const char *stubpath;
static long FLAG_SizeOfStackCommit = 64 * 1024;
static long FLAG_SizeOfStackReserve = 8 * 1024 * 1024;
#include "libc/mem/tinymalloc.inc"
static wontreturn void Die(const char *thing, const char *reason) {
tinyprint(2, thing, ": ", reason, "\n", NULL);
exit(1);