Implement reference counting (#592)

This commit is contained in:
Daniel Wirtz
2019-06-05 23:15:39 +02:00
committed by GitHub
parent 3ed76a97f0
commit 0484a6b740
601 changed files with 261645 additions and 146131 deletions

View File

@ -1,5 +1,3 @@
import "allocator/arena";
// trailing conditional allocate
class EmptyCtor {
constructor() {}
@ -46,7 +44,7 @@ var justFieldNoInit = new JustFieldNoInit();
// explicit allocation with no extra checks
class CtorReturns {
constructor() {
return changetype<CtorReturns>(memory.allocate(0));
return changetype<CtorReturns>(0);
}
}
@ -58,7 +56,7 @@ var b: bool = true;
class CtorConditionallyReturns {
constructor() {
if (b) {
return changetype<CtorConditionallyReturns>(memory.allocate(0));
return changetype<CtorConditionallyReturns>(0);
}
}
}