- http://build.servo.org/builders/linux-rel-css/builds/2149
- http://build.servo.org/builders/linux-rel-wpt/builds/2163
- http://build.servo.org/builders/mac-dev-unit/builds/5445
- http://build.servo.org/builders/mac-rel-wpt1/builds/2139
- http://build.servo.org/builders/mac-rel-wpt2/builds/2194
- http://build.servo.org/builders/windows-gnu-dev/builds/605
- http://build.servo.org/builders/windows-msvc-dev/builds/610
- http://build.servo.org/builders/arm32/builds/5324
- http://build.servo.org/builders/arm64/builds/5364
- http://build.servo.org/builders/android/builds/5140
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(libc)] | |
#![feature(test)] | |
extern crate libc; | |
extern crate test; | |
extern crate seahash; | |
use std::slice; | |
use std::ffi::CStr; | |
use std::panic; | |
use std::str; |
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
[package] | |
name = "workspace" | |
version = "0.1.0" | |
authors = ["Matt Brubeck <[email protected]>"] | |
[lib] | |
name = "workspace" | |
crate-type = ["staticlib"] | |
[dependencies] |
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 crypto; | |
extern crate rand; | |
use crypto::aes; | |
use crypto::buffer::{ReadBuffer, WriteBuffer, RefReadBuffer, RefWriteBuffer, BufferResult}; | |
use crypto::blockmodes::PkcsPadding; | |
use rand::{Rng, OsRng}; | |
use std::fs::File; | |
use std::io; | |
use std::io::prelude::*; |
Rust | C | C++ | |
---|---|---|---|
Initial buffer | file size or 1 MB | 16 KB | file size* |
Buffer growth | 8 KB | doubling | n/a |
Max read() | buffer size | 16 KB | 128 B |
Work unit | 2 KB | entire sequence | 64 KB |
* the C++ code crashes if the input is not a 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
use std::{cmp, mem, ops, ptr, slice}; | |
use std::marker::PhantomData; | |
/// A growable vector the width of a single pointer. | |
/// | |
/// `PointerVec<T>` is similar to the standard `Vec<T>` type, but it stores its length and capacity | |
/// fields in its heap allocation, rather than inline. This means that the `PointerVec` struct | |
/// itself only has a single field, the pointer to the heap. | |
pub struct PointerVec<T> { | |
ptr: *mut Header, |
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
#include <stdio.h> | |
void main() { | |
int x = 5; | |
int *p = &x; | |
int *q = &*p; | |
*q = 6; | |
printf("%d\n", x); | |
} |
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(const_fn)] | |
// rust self-tracing benchmark using DebugCtl.BTF | |
extern crate winapi; | |
extern crate kernel32; | |
extern crate libc; | |
use std::time::Instant; |
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
#![no_std] | |
#![feature(alloc_system, lang_items)] | |
extern crate alloc_system; | |
pub fn foo() -> u32 { | |
42 | |
} | |
#[lang = "eh_personality"] extern fn eh_personality() {} | |
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} } |
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
inside: TreeIterator { current: Tree { nodes: [None, None] }, depth: 0 } | |
Got out Tree { nodes: [None, None] } | |
After first inc(0) Tree { nodes: [None, None] } | |
After second inc(1) Tree { nodes: [Some(Tree { nodes: [None, None] }), None] } | |
next tree: Some(Tree { nodes: [None, None] }) | |
inside: TreeIterator { current: Tree { nodes: [Some(Tree { nodes: [None, None] }), None] }, depth: 1 } | |
Got out Tree { nodes: [Some(Tree { nodes: [None, None] }), Some(Tree { nodes: [None, None] })] } | |
After first inc(1) Tree { nodes: [Some(Tree { nodes: [None, None] }), Some(Tree { nodes: [None, None] })] } | |
next tree: Some(Tree { nodes: [Some(Tree { nodes: [None, None] }), Some(Tree { nodes: [None, None] })] }) | |
inside: TreeIterator { current: Tree { nodes: [Some(Tree { nodes: [None, None] }), Some(Tree { nodes: [None, None] })] }, depth: 1 } |