Skip to content

Commit

Permalink
Quick test nostd build
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Kaitchuck <tom.kaitchuck@emc.com>
  • Loading branch information
tkaitchuck committed Aug 6, 2024
1 parent 58cc385 commit 784a6e7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test-block/Cargo.toml
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"
31 changes: 31 additions & 0 deletions test-block/src/main.rs
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
}

0 comments on commit 784a6e7

Please sign in to comment.