Added cwasm_arena.c and cwasm_debug.c. Arena API hasn't been tested well yet. There's also something wrong with our DebugOutputLineBuffer usage for splitting lines to multiple Javascript output calls. Also added an int level to jsStdPrint and a bunch of macros to cwasm.h

This commit is contained in:
2025-08-31 17:33:48 -07:00
parent d0aa7a1d0e
commit cca61ea163
9 changed files with 566 additions and 11 deletions

View File

@@ -8,4 +8,20 @@ Description:
#include "cwasm.c"
#define SCRATCH_ARENAS_SIZE Kilobytes(128)
WASM_EXPORT(InitializeApp) void InitializeApp()
{
InitializeCWasm(SCRATCH_ARENAS_SIZE);
}
WASM_EXPORT(HelloFromWasm) float HelloFromWasm(float value, float value2)
{
printf("Called HelloFromWasm(%g)!\n", fmodf(value, value2));
for (int iIndex = 0; iIndex < 1024; iIndex++)
{
void* newMem = grow_mem(1024);
printf("mem[%d] = %p\n", iIndex, newMem);
}
return value*(value+1)*2;
}