mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-31 06:02:11 +00:00
Implement reference counting (#592)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import "allocator/arena";
|
||||
|
||||
// From The Computer Language Benchmarks Game
|
||||
// http://benchmarksgame.alioth.debian.org
|
||||
|
||||
@@ -96,7 +94,7 @@ class NBodySystem {
|
||||
py += b.vy * m;
|
||||
pz += b.vz * m;
|
||||
}
|
||||
bodies[0].offsetMomentum(px, py, pz);
|
||||
unchecked(bodies[0]).offsetMomentum(px, py, pz);
|
||||
}
|
||||
|
||||
advance(dt: float): void {
|
||||
@@ -206,5 +204,5 @@ export function bench(steps: u32): void {
|
||||
|
||||
export function getBody(index: i32): Body | null {
|
||||
var bodies = system.bodies;
|
||||
return <u32>index < <u32>bodies.length ? bodies[index] : null;
|
||||
return <u32>index < <u32>bodies.length ? unchecked(bodies[index]) : null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user