aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-09-29 17:22:07 -0700
committerGraydon Hoare <[email protected]>2010-09-29 17:22:13 -0700
commitb970563fe3f36853250f4cef65a8425431789e8b (patch)
treec09d7d39a46419c24ea88164ee047c10ebd7da39 /src/lib
parentAllow tag recursion through vectors as well as boxes (diff)
downloadrust-b970563fe3f36853250f4cef65a8425431789e8b.tar.xz
rust-b970563fe3f36853250f4cef65a8425431789e8b.zip
Patchwork of attempted fixes to effect system and gc system; eventually give up and disable it entirely in the runtime. Will need extensive reworking.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/map.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/map.rs b/src/lib/map.rs
index 9ebfd4b6..cdc2d025 100644
--- a/src/lib/map.rs
+++ b/src/lib/map.rs
@@ -12,15 +12,15 @@ import std._vec;
type hashfn[K] = fn(&K) -> uint;
type eqfn[K] = fn(&K, &K) -> bool;
-type hashmap[K, V] = obj {
- fn size() -> uint;
- fn insert(&K key, &V val) -> bool;
- fn contains_key(&K key) -> bool;
- fn get(&K key) -> V;
- fn find(&K key) -> util.option[V];
- fn remove(&K key) -> util.option[V];
- fn rehash();
- iter items() -> tup(K,V);
+state type hashmap[K, V] = state obj {
+ fn size() -> uint;
+ fn insert(&K key, &V val) -> bool;
+ fn contains_key(&K key) -> bool;
+ fn get(&K key) -> V;
+ fn find(&K key) -> util.option[V];
+ fn remove(&K key) -> util.option[V];
+ fn rehash();
+ iter items() -> tup(K,V);
};
fn mk_hashmap[K, V](&hashfn[K] hasher, &eqfn[K] eqer) -> hashmap[K, V] {
@@ -141,12 +141,12 @@ fn mk_hashmap[K, V](&hashfn[K] hasher, &eqfn[K] eqer) -> hashmap[K, V] {
}
}
- obj hashmap[K, V](hashfn[K] hasher,
- eqfn[K] eqer,
- mutable vec[mutable bucket[K, V]] bkts,
- mutable uint nbkts,
- mutable uint nelts,
- util.rational lf)
+ state obj hashmap[K, V](hashfn[K] hasher,
+ eqfn[K] eqer,
+ mutable vec[mutable bucket[K, V]] bkts,
+ mutable uint nbkts,
+ mutable uint nelts,
+ util.rational lf)
{
fn size() -> uint { ret nelts; }