Files
CWasm/test_app.c

28 lines
631 B
C

/*
File: test_app.c
Author: Taylor Robbins
Date: 08\28\2025
Description:
** When no other application is present, this serves as a simple test case for the CWasm layer
*/
#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;
}