mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-09 05:06:17 +00:00

Fix some issues and add basic unit test case for shared heap feature. Signed-off-by: wenlingyun1 <wenlingyun1@xiaomi.com>
22 lines
355 B
C
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;
|
|
} |