-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tom Kaitchuck <[email protected]>
- Loading branch information
1 parent
58cc385
commit 784a6e7
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "test-block" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[profile.release] | ||
panic = 'abort' | ||
|
||
[profile.test] | ||
panic = 'abort' | ||
|
||
[profile.dev] | ||
panic = 'abort' | ||
|
||
[dependencies] | ||
ahash = { path = "../", default-features = false } | ||
spin = "0.9.8" | ||
talc = "4.4.1" | ||
panic-abort = "0.3.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#![no_std] | ||
#![feature(start)] | ||
|
||
use ahash::RandomState; | ||
|
||
use talc::*; | ||
|
||
extern crate alloc; | ||
extern crate panic_abort; | ||
|
||
static mut ARENA: [u8; 1024*1024] = [0; 1024*1024]; | ||
|
||
#[global_allocator] | ||
static ALLOCATOR: Talck<spin::Mutex<()>, ClaimOnOom> = Talc::new(unsafe { | ||
// if we're in a hosted environment, the Rust runtime may allocate before | ||
// main() is called, so we need to initialize the arena automatically | ||
ClaimOnOom::new(Span::from_const_array(core::ptr::addr_of!(ARENA))) | ||
}).lock(); | ||
|
||
|
||
#[start] | ||
fn start(_argc: isize, _argv: *const *const u8) -> isize { | ||
// let state = RandomState::with_seeds(1, 2, 3, 4); | ||
//let mut sum: u64 = 0; | ||
// let mut payload: [u8; 8196] = [0; 8196]; | ||
// for i in 0..1024 { | ||
// payload.fill(i as u8); | ||
// sum = sum.wrapping_add(state.hash_one(&payload)); | ||
// } | ||
0 as isize | ||
} |