This file contains hidden or 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
| #![feature(nll)] | |
| #[macro_use] | |
| extern crate pollock; | |
| extern crate serde; | |
| #[macro_use] | |
| extern crate serde_derive; | |
| use pollock::*; |
This file contains hidden or 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
| #![feature(nll)] | |
| extern crate pollock; | |
| extern crate serde; | |
| #[macro_use] | |
| extern crate serde_derive; | |
| use pollock::*; | |
| #[derive(Serialize, Deserialize)] |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
| # callgrind format | |
| version: 1 | |
| creator: callgrind-3.13.0 | |
| pid: 6359 | |
| cmd: target/release/rustfest-5c3dd55c20998644 --bench | |
| part: 1 | |
| desc: I1 cache: 32768 B, 64 B, 8-way associative | |
| desc: D1 cache: 32768 B, 64 B, 8-way associative |
This file contains hidden or 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
| extern crate smallvec; | |
| use smallvec::SmallVec; | |
| struct Printer(usize); | |
| impl Drop for Printer { | |
| fn drop(&mut self) { | |
| println!("Dropping {}", self.0); | |
| } |
This file contains hidden or 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
| libbigint.so`disassemble: | |
| pushq %rbp | |
| movq %rsp, %rbp | |
| pushq %r15 | |
| pushq %r14 | |
| pushq %r13 | |
| pushq %r12 | |
| pushq %rbx | |
| subq $0x50, %rsp | |
| movq 0x10(%rbp), %r14 |
This file contains hidden or 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
| use std::{str, mem, ptr, slice}; | |
| use std::ops::Deref; | |
| pub struct CowStr<'a>(CowVec<'a, u8>); | |
| impl<'a> CowStr<'a> { | |
| #[inline] | |
| pub fn borrowed(b: &'a str) -> Self { | |
| CowStr(CowVec::borrowed(b.as_bytes())) | |
| } |
This file contains hidden or 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
| pub struct VecBuilder<'a, T: 'a> { | |
| inner: *mut Vec<T>, | |
| _marker: std::marker::PhantomData<&'a mut Vec<T>>, | |
| } | |
| impl<'a, T> VecBuilder<'a, T> { | |
| pub fn new(v: &'a mut Vec<T>) -> Self { | |
| VecBuilder { | |
| inner: v, | |
| _marker: Default::default(), |
This file contains hidden or 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
| #[macro_use] | |
| extern crate combine; | |
| use std::collections::HashMap; | |
| #[derive(Debug, Clone)] | |
| enum Ast { | |
| Lit(Value), | |
| Variable(String), | |
| Call(Box<Ast>, Vec<Ast>), |
This file contains hidden or 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
| pub fn disassemble() { | |
| let smallvec: SmallVec<[_; 16]> = smallvec![10; 100]; | |
| test::black_box(smallvec); | |
| } |
This file contains hidden or 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
| // Low-level interface, we can implement a higher-level interface as a library | |
| mod pwasm { | |
| use std::marker::PhantomData; | |
| pub struct ContractDef<State> { | |
| state: State, | |
| iterate: for<'a> fn(&'a EthEnv, State, MessageData) -> (State, ReturnData), | |
| } | |
| // Will it ever be possible to get arbitrary blocks? |