wasm-micro-runtime/tests/unit/shared-heap/wasm-apps/test.c
WenLY1 4dacef2d60
shared heap: Fix some issues and add basic unit test case (#3801)
Fix some issues and add basic unit test case for shared heap feature.

Signed-off-by: wenlingyun1 <wenlingyun1@xiaomi.com>
2024-09-20 14:24:38 +08:00

22 lines
355 B
C

/*
* Copyright (C) 2024 Xiaomi Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/
#include <stdio.h>
extern void *
shared_malloc(int size);
extern void
shared_free(void *offset);
int
test()
{
int *ptr = (int *)shared_malloc(10);
*ptr = 10;
int a = *ptr;
shared_free(ptr);
return a;
}