Compare commits
2 Commits
c62b5c903d
...
5478e5e40e
Author | SHA1 | Date | |
---|---|---|---|
|
5478e5e40e | ||
|
f6cbe3f800 |
0
pkg/.gitignore
vendored
Normal file
0
pkg/.gitignore
vendored
Normal file
|
@ -1,3 +0,0 @@
|
|||
# rudus
|
||||
|
||||
A Rust implementation of Ludus.
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"name": "rudus",
|
||||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"files": [
|
||||
"rudus_bg.wasm",
|
||||
"rudus.js",
|
||||
"rudus.d.ts"
|
||||
],
|
||||
"main": "rudus.js",
|
||||
"types": "rudus.d.ts",
|
||||
"sideEffects": [
|
||||
"./snippets/*"
|
||||
]
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
import * as mod from "./ludus.js";
|
||||
|
||||
console.log(mod.run(`
|
||||
:foobar
|
||||
`));
|
0
pkg/worker.js
Normal file
0
pkg/worker.js
Normal file
|
@ -3,7 +3,7 @@ use crate::value::Value;
|
|||
use crate::vm::{Creature, Panic};
|
||||
use ran::ran_u8;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::mem::swap;
|
||||
use std::rc::Rc;
|
||||
use std::time::{Duration, Instant};
|
||||
|
@ -67,7 +67,7 @@ pub struct Zoo {
|
|||
procs: Vec<Status>,
|
||||
empty: Vec<usize>,
|
||||
ids: HashMap<&'static str, usize>,
|
||||
dead: Vec<&'static str>,
|
||||
dead: HashSet<&'static str>,
|
||||
kill_list: Vec<&'static str>,
|
||||
sleeping: HashMap<&'static str, (Instant, Duration)>,
|
||||
active_idx: usize,
|
||||
|
@ -81,7 +81,7 @@ impl Zoo {
|
|||
empty: vec![],
|
||||
ids: HashMap::new(),
|
||||
kill_list: vec![],
|
||||
dead: vec![],
|
||||
dead: HashSet::new(),
|
||||
sleeping: HashMap::new(),
|
||||
active_idx: 0,
|
||||
active_id: "",
|
||||
|
@ -155,7 +155,7 @@ impl Zoo {
|
|||
self.procs[*idx] = Status::Empty;
|
||||
self.empty.push(*idx);
|
||||
self.ids.remove(id);
|
||||
self.dead.push(id);
|
||||
self.dead.insert(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user