Skip to content

Instantly share code, notes, and snippets.

View ILyoan's full-sized avatar

ILYONG CHO ILyoan

  • Samsung Electronics
  • Suwon, Korea
View GitHub Profile
@ILyoan
ILyoan / gist:6945608
Created October 12, 2013 03:51
start_on_main_thread benchmark
extern mod extra;
use std::io;
use std::comm;
use std::task;
use extra::time::precise_time_ns;
#[start]
fn start(argc: int, argv: **u8) -> int {
do std::rt::start_on_main_thread(argc, argv) {
@ILyoan
ILyoan / gist:5656462
Created May 27, 2013 10:52
ICE when giving folder name
RUST_LOG=rustc=1,::rt::backtrace ./x86_64-unknown-linux-gnu/stage2/bin/rust run dl
rust: task failed at 'explicit failure', /home/ilyoan/project/rust/rust/src/libstd/io.rs:926
/home/ilyoan/project/rust/rust/build/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x4b)[0x7fa0cc2bf04b]
/home/ilyoan/project/rust/rust/build/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustrt.so(+0x2b7c9)[0x7fa0cc2d07c9]
/home/ilyoan/project/rust/rust/build/x86_64-unknown-linux-gnu/stage2/bin/../lib/librustrt.so(upcall_fail+0x1a8)[0x7fa0cc2c10b8]
/home/ilyoan/project/rust/rust/build/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-c3ca5d77d81b46c1-0.7-pre.so(_ZN3sys13begin_unwind_17_bdd0fd58907ecc496_07preE+0x1ad)[0x7fa0ced1f99d]
/home/ilyoan/project/rust/rust/build/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-c3ca5d77d81b46c1-0.7-pre.so(+0x135d82)[0x7fa0ced1fd82]
/home/ilyoan/project/rust/rust/build/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-c3ca5d77d81b46c1-0.7-pre.so(+0
run-pass tests that failed because of issue 6231
alignment-gep-tup-like-2
child-outlives-parent
cleanup-copy-mode
clone-with-exterior
comm
core-run-destroy
cycle-collection
cycle-collection2
@ILyoan
ILyoan / gist:5538590
Last active December 17, 2015 02:49
ApproxEq
pub trait ApproxEq<Eps> {
fn absolute_epsilon() -> Eps;
fn relative_epsilon() -> Eps;
fn approx_eq(&self, other: &Self) -> bool;
fn approx_eq_eps(&self, other: &Self, absolute_epsilon: &Eps) -> bool;
fn approx_eq_eps(&self, other: &Self, absolute_epsilon: &Eps, relative_epsilon: &Eps) -> bool;
}
impl ApproxEq<f32> for f32 {
#[inline(always)]
@ILyoan
ILyoan / gist:5392936
Last active December 16, 2015 06:39
This is a snippet of segmented stack manipulation for ARM. This snippet contains stack related parts so you can generate unwind table as the same as full version. (other parts are just commented for understand)
/*
This is a snippet of segmented stack manipulation for ARM.
This snippet contains stack related parts so you can generate unwind table as the same as full version.
(other parts are just commented for understand)
Compiled with gas, llvm-objdump shows extab as follow
Contents of section .ARM.extab:
0000 00000000 84419b01 b0b0b083 409b0281 .....A......@...
0010 84848496 b0b0a100 00000000 ............
@ILyoan
ILyoan / gist:5136153
Created March 11, 2013 17:50
rust fuzzy_eq 2
extern mod std;
use std::cmp::FuzzyEq;
fn Foo(foo: float) -> float {
return foo * (1f/11f) * 3f;
}
fn Bar(bar: float) -> float {
return bar * (3f/11f);
}
@ILyoan
ILyoan / gist:5136141
Created March 11, 2013 17:49
rust fuzzy_eq
extern mod std;
use std::cmp::FuzzyEq;
fn Foo(foo: float) -> float {
return foo * (1f/11f) * 3f;
}
fn Bar(bar: float) -> float {
return bar * (3f/11f);
}
@ILyoan
ILyoan / gist:4530083
Created January 14, 2013 13:33
exception case 2
#[main]
fn main() {
}
fn main() {
}
@ILyoan
ILyoan / gist:4530073
Created January 14, 2013 13:30
exception case 1
mod foo {
fn main() {
}
}
mod bar {
fn main() {
}
}
#[main]
fn main() {