Skip to content

Instantly share code, notes, and snippets.

View pepyakin's full-sized avatar

Sergei Shulepov pepyakin

View GitHub Profile
@pepyakin
pepyakin / playground.rs
Created September 14, 2017 12:22 — forked from anonymous/playground.rs
Rust code shared from the playground
#![feature(core_intrinsics)]
use std::os::raw::c_char;
use std::ffi::{CStr, CString};
use std::ptr;
trait ToCStr<T> {
fn borrow_ptr(self) -> (T, *const c_char);
}
@pepyakin
pepyakin / playground.rs
Last active May 31, 2016 13:23 — forked from anonymous/playground.rs
Shared via Rust Playground
struct Vm {
pc: usize,
}
impl Vm {
fn new() -> Vm {
Vm { pc: 0 }
}
fn execute<F>(&mut self, mut probe: F)