Web: Change to a webworker architecture to stop freezing main thread

This commit is contained in:
2025-12-20 01:16:03 +01:00
parent 66feaab027
commit 92ce48997d
7 changed files with 277 additions and 178 deletions

7
sys.h
View File

@@ -15,14 +15,13 @@ enum { /* TODO */
SYS_MADV_SEQUENTIAL = 0,
};
static uint8_t g_buf[1024*1024*1024];
static uint8_t g_buf[1024*1024*1024 /* 1 GB */];
static size_t g_buf_len = 0;
static void* sys_mmap_anon_shared(size_t size, int, int)
{
/* FIXME: this program relies on few memory allocations, a simple bump
* allocator works for now, but will cause memory leaks in the future */
/* FIXME: this program relies on very few memory allocations, a simple bump
* allocator works for now, but will cause memory leaks in the future */
size = (size + 7ULL) & ~7ULL;
if (g_buf_len + size > sizeof g_buf) {