feat: extend wasm backend entrypoints

This commit is contained in:
root
2026-06-13 21:50:19 +00:00
parent fe83c52411
commit d6421cb8f3
14 changed files with 315 additions and 83 deletions
+26
View File
@@ -16,6 +16,32 @@
#include "types.h"
// Single definition of context for the native split build (the wasm core/unit
// builds keep the in-place definition from types.h — see the guard there).
#if !defined(__UCE_WASM_CORE__) && !defined(__UCE_WASM_UNIT__)
Request* context = 0;
#endif
#ifndef __UCE_WASM_UNIT__
void * operator new(decltype(sizeof(0)) n) noexcept(false)
{
void* ptr = malloc(n);
if(context)
{
context->stats.mem_alloc += n;
if(context->stats.mem_alloc > context->stats.mem_high)
context->stats.mem_high = context->stats.mem_alloc;
}
return(ptr);
}
void operator delete(void * p) throw()
{
//TO DO: track deallocations
free(p);
}
#endif
namespace {
String http_status_reason(s32 code)