mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-15 07:51:32 +00:00
Rework static memory segment creation; Fix stdlib gc hooks not marking own fields; Align everything to 8 bytes that might be touched by GC
This commit is contained in:
23
tests/compiler/std/gc-array.ts
Normal file
23
tests/compiler/std/gc-array.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import "allocator/arena";
|
||||
import "collector/itcm";
|
||||
|
||||
class Foo {
|
||||
}
|
||||
|
||||
var arr: Foo[] = [];
|
||||
|
||||
gc.collect(); // should do nothing
|
||||
|
||||
arr[0] = {};
|
||||
|
||||
gc.collect(); // should do nothing
|
||||
|
||||
arr[1] = {};
|
||||
|
||||
gc.collect(); // should do nothing
|
||||
|
||||
arr[0] = {};
|
||||
|
||||
gc.collect(); // should collect the old one
|
||||
|
||||
export function main(): i32 { return 0; }
|
Reference in New Issue
Block a user