The arcu crate is a more general implementation of the Rcu I implemented in here in scryer. It contains some bug-fixes regarding race-conditions in the Rcu update function, which could cause leaks and uses after free. Source of the problem was the Relaxed load/strore/update of the reference count in side the Arc not being properly ordered with other load/stores.
59 lines
1.1 KiB
Rust
59 lines
1.1 KiB
Rust
#![recursion_limit = "4112"]
|
|
|
|
#[macro_use]
|
|
extern crate static_assertions;
|
|
#[cfg(test)]
|
|
#[macro_use]
|
|
extern crate maplit;
|
|
|
|
#[macro_use]
|
|
pub mod macros;
|
|
#[macro_use]
|
|
pub mod atom_table;
|
|
#[macro_use]
|
|
pub mod arena;
|
|
#[macro_use]
|
|
pub mod parser;
|
|
mod allocator;
|
|
mod arithmetic;
|
|
pub mod codegen;
|
|
mod debray_allocator;
|
|
#[cfg(feature = "ffi")]
|
|
mod ffi;
|
|
mod forms;
|
|
mod heap_iter;
|
|
pub mod heap_print;
|
|
#[cfg(feature = "http")]
|
|
mod http;
|
|
mod indexing;
|
|
mod variable_records;
|
|
#[macro_use]
|
|
pub mod instructions {
|
|
include!(concat!(env!("OUT_DIR"), "/instructions.rs"));
|
|
}
|
|
mod iterators;
|
|
pub mod machine;
|
|
mod raw_block;
|
|
pub mod read;
|
|
#[cfg(feature = "repl")]
|
|
mod repl_helper;
|
|
mod targets;
|
|
pub mod types;
|
|
|
|
use instructions::instr;
|
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
#[wasm_bindgen]
|
|
pub fn eval_code(s: &str) -> String {
|
|
use machine::mock_wam::*;
|
|
|
|
console_error_panic_hook::set_once();
|
|
|
|
let mut wam = Machine::with_test_streams();
|
|
let bytes = wam.test_load_string(s);
|
|
String::from_utf8_lossy(&bytes).to_string()
|
|
}
|