Skip to content

Instantly share code, notes, and snippets.

Amanieu d'Antras Amanieu

Block or report user

Report or block Amanieu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View hashbrown
time: 0.088; rss: 74MB parsing
time: 0.000; rss: 74MB attributes injection
time: 0.000; rss: 74MB recursion limit
time: 0.000; rss: 74MB crate injection
time: 0.000; rss: 74MB plugin loading
time: 0.000; rss: 74MB plugin registration
time: 0.005; rss: 74MB pre ast expansion lint checks
time: 0.305; rss: 163MB expand crate
time: 0.000; rss: 163MB check unused macros
time: 0.305; rss: 163MB expansion
View scopeguard.rs
// Extracted from the scopeguard crate
use core::ops::{Deref, DerefMut};
pub struct ScopeGuard<T, F>
where
F: FnMut(&mut T),
{
dropfn: F,
value: T,
}
View thumb16.rs
use core::hint;
pub mod encode {
#[inline]
pub fn shift_immed(ty: u32, imm5: u32, Rm: u32, Rd: u32) -> u32 {
let mut out = 0;
out |= 0x0 << 29;
out |= (ty as u32 & 0x3) << 27;
out |= (imm5 as u32 & 0x1f) << 22;
out |= (Rm as u32 & 0x7) << 19;
View thumb32.rs
Instruction::SMLAW_16(fields) => {
if trans.config().strict_unpredictable {
if fields.Rd() == 15 || fields.Rm() == 15 || fields.Rn() == 15 {
return translate_unpredictable(trans);
}
}
let n = trans.get_reg(fields.Rn());
let m = trans.get_reg(fields.Rm());
let a = if fields.Ra() == 15 {
View gist:433ba54159a59dade6ac5dd37984c3c8
$ RUST_BACKTRACE=1 target/release/cton-util wasm -T --set is_64bit=1 --isa x86 ../wasm-collection/misc-valid/AngryBots1.wasm
thread 'main' panicked at 'Invalid type for vsplit', libcore/option.rs:914:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::print
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
2: std::panicking::default_hook::{{closure}}
at libstd/panicking.rs:211
View gist:3b37c6c0108336fea559c8a29b7c2cd3
thread 'main' panicked at 'Expected register: Unassigned', lib/codegen/src/ir/valueloc.rs:40:18
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::print
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
2: std::panicking::default_hook::{{closure}}
at libstd/panicking.rs:211
3: std::panicking::default_hook
View send_handle.rs
struct SendHandle {
handle: Handle,
guard: Option<Guard>,
}
unsafe impl Send for SendHandle {}
impl SendHandle {
pub fn new(handle: Handle) -> SendHandle {
SendHandle {
handle,
guard: None,
View unsafe.rs
extern crate crossbeam;
extern crate fringe;
use fringe::generator::*;
use fringe::OsStack;
use std::ptr;
use std::thread;
fn do_stuff(x: &mut i32) {
loop {
unsafe {
View encode.patch
diff --git a/src/generator.rs b/src/generator.rs
index 6870c29..9065e38 100644
--- a/src/generator.rs
+++ b/src/generator.rs
@@ -88,6 +88,32 @@ pub struct Generator<Input: Send, Output: Send, Stack: stack::Stack> {
phantom: (PhantomData<*const Input>, PhantomData<*const Output>)
}
+unsafe fn encode<T>(val: &T) -> usize {
+ if mem::size_of::<T>() <= mem::size_of::<usize>() &&
View bench.txt
x86_64
======
master:
context: 4.7 ns
generator: 7.3 ns
Amanieu:
context: 4.7 ns
generator: 6.5 ns
You can’t perform that action at this time.