feat: extend wasm backend entrypoints
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user