add testcases for shared heap and fix POP_MEM_OFFSET of memory64 (#3916)
- add testcases for shared_heap - fix POP_MEM_OFFSET and POP_TBL_ELEM_IDX of memory64 Signed-off-by: wenlingyun1 <wenlingyun1@xiaomi.com>
This commit is contained in:
@ -13,10 +13,22 @@ shared_heap_free(void *offset);
|
||||
int
|
||||
test()
|
||||
{
|
||||
int *ptr = (int *)shared_heap_malloc(10);
|
||||
int *ptr = (int *)shared_heap_malloc(4);
|
||||
|
||||
*ptr = 10;
|
||||
int a = *ptr;
|
||||
shared_heap_free(ptr);
|
||||
return a;
|
||||
}
|
||||
|
||||
int
|
||||
test_malloc_fail()
|
||||
{
|
||||
int *ptr = (int *)shared_heap_malloc(8192);
|
||||
|
||||
if (ptr == NULL) {
|
||||
return 1;
|
||||
}
|
||||
shared_heap_free(ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user