take a step back

This commit is contained in:
dcode
2019-03-14 04:33:58 +01:00
parent e38f627c8b
commit 6163a73ab5
30 changed files with 645 additions and 1287 deletions

View File

@ -1,4 +1,4 @@
import { LINK } from "./runtime";
import { runtime } from "./runtime";
import { HASH } from "./util/hash";
// A deterministic hash map based on CloseTable from https://github.com/jorendorff/dht
@ -108,8 +108,8 @@ export class Map<K,V> {
let bucketPtrBase = changetype<usize>(this.buckets) + <usize>(hashCode & this.bucketsMask) * BUCKET_SIZE;
entry.taggedNext = load<usize>(bucketPtrBase);
store<usize>(bucketPtrBase, changetype<usize>(entry));
if (isManaged<K>()) LINK(changetype<usize>(key), changetype<usize>(this));
if (isManaged<V>()) LINK(changetype<usize>(value), changetype<usize>(this));
if (isManaged<K>()) runtime.link(changetype<usize>(key), changetype<usize>(this));
if (isManaged<V>()) runtime.link(changetype<usize>(value), changetype<usize>(this));
}
}