This file contains 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
/* | |
Boost Software License - Version 1.0 - August 17th, 2003 | |
Permission is hereby granted, free of charge, to any person or organization | |
obtaining a copy of the software and accompanying documentation covered by | |
this license (the "Software") to use, reproduce, display, distribute, | |
execute, and transmit the Software, and to prepare derivative works of the | |
Software, and to permit third-parties to whom the Software is furnished to | |
do so, all subject to the following: | |
The copyright notices in the Software and this entire statement, including | |
the above license grant, this restriction and the following disclaimer, |
This file contains 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
import core.simd: void16, loadUnaligned, storeUnaligned; | |
pragma(inline, true) | |
void rte_mov16(ubyte *dst, ubyte*src) { | |
storeUnaligned(cast(void16*)(dst), loadUnaligned(cast(void16*)(src))); | |
} | |
pragma(inline, true) | |
void rte_mov32(ubyte *dst, ubyte *src) { | |
storeUnaligned(cast(void16*)(dst), loadUnaligned(cast(void16*)(src))); |
This file contains 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)] | |
#![feature(associated_consts)] | |
#![allow(dead_code)] | |
#![allow(non_camel_case_types)] | |
use std::marker::PhantomData; | |
use std::ptr; | |
pub trait ConstantValue<T> { | |
const VALUE: T; |
This file contains 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
trait Foo { | |
fn foo(&self) {} | |
} | |
trait Bar { | |
fn bar(&self) {} | |
} | |
macro_rules! manyimpl { | |
($st: ty, $tr: ty) => { impl $tr for $st { } }; |
This file contains 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::ptr; | |
use std::marker::PhantomData; | |
trait ReadWrite { | |
unsafe fn read<T>(src: *const T) -> T; | |
unsafe fn write<T>(dst: *mut T, src: T); | |
} | |
enum Volatile {} | |
enum NonVolatile {} |
This file contains 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)] | |
#![feature(associated_consts)] | |
use std::ptr::*; | |
use std::mem; | |
#[derive(Copy, Clone)] | |
pub struct BitField (u8, u8); | |
trait FromBits<T> { |