mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-31 22:22:13 +00:00
slim down runtime
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
import { link_count, unlink_count, collect_count } from "./gc/_dummy";
|
||||
export { runtime, gc };
|
||||
|
||||
class Ref {}
|
||||
|
||||
@start export function main(): void {
|
||||
var ref = new Ref();
|
||||
|
||||
assert(gc.implemented);
|
||||
|
||||
var previous_link_count = link_count;
|
||||
var previous_unlink_count = unlink_count;
|
||||
var previous_collect_count = collect_count;
|
||||
|
||||
gc.retain(changetype<usize>(ref));
|
||||
runtime.retain(changetype<usize>(ref));
|
||||
|
||||
assert(link_count == previous_link_count + 1);
|
||||
assert(unlink_count == previous_unlink_count);
|
||||
@@ -21,7 +18,7 @@ class Ref {}
|
||||
previous_unlink_count = unlink_count;
|
||||
previous_collect_count = collect_count;
|
||||
|
||||
gc.release(changetype<usize>(ref));
|
||||
runtime.release(changetype<usize>(ref));
|
||||
|
||||
assert(link_count == previous_link_count);
|
||||
assert(unlink_count == previous_unlink_count + 1);
|
||||
@@ -30,7 +27,7 @@ class Ref {}
|
||||
previous_unlink_count = unlink_count;
|
||||
previous_collect_count = collect_count;
|
||||
|
||||
gc.collect();
|
||||
runtime.collect();
|
||||
|
||||
assert(link_count == previous_link_count);
|
||||
assert(unlink_count == previous_unlink_count);
|
||||
|
Reference in New Issue
Block a user