1
0
Fork 0

big rename — we're libfringe now

This commit is contained in:
edef 2015-04-16 08:06:57 -04:00
parent af7e9ea67c
commit d627f0d725
21 changed files with 34 additions and 12 deletions

View File

@ -1,5 +1,5 @@
[package] [package]
name = "lwkt" name = "fringe"
version = "0.0.1" version = "0.0.1"
authors = ["edef <edef@edef.eu>"] authors = ["edef <edef@edef.eu>"]
build = "build.rs" build = "build.rs"

View File

@ -1,3 +1,4 @@
libfringe, a low-level green threading library.
Copyright (c) 2015, edef <edef@edef.eu> Copyright (c) 2015, edef <edef@edef.eu>
Permission to use, copy, modify, and/or distribute this software for any Permission to use, copy, modify, and/or distribute this software for any

View File

@ -1,9 +1,10 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
#![feature(test)] #![feature(test)]
extern crate test; extern crate test;
extern crate lwkt; extern crate fringe;
use lwkt::{Context, Stack}; use fringe::{Context, Stack};
static mut ctx_slot: *mut Context<'static, SliceStack<'static>> = 0 as *mut Context<_>; static mut ctx_slot: *mut Context<'static, SliceStack<'static>> = 0 as *mut Context<_>;
static mut stack_buf: [u8; 1024] = [0; 1024]; static mut stack_buf: [u8; 1024] = [0; 1024];
@ -27,7 +28,7 @@ fn context_new(b: &mut test::Bencher) {
} }
struct SliceStack<'a>(&'a mut [u8]); struct SliceStack<'a>(&'a mut [u8]);
impl<'a> lwkt::Stack for SliceStack<'a> { impl<'a> fringe::Stack for SliceStack<'a> {
fn top(&mut self) -> *mut u8 { fn top(&mut self) -> *mut u8 {
unsafe { unsafe {
self.0.as_mut_ptr().offset(self.0.len() as isize) self.0.as_mut_ptr().offset(self.0.len() as isize)

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
#![feature(asm, test)] #![feature(asm, test)]

View File

@ -1,16 +1,17 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
#![feature(test)] #![feature(test)]
extern crate test; extern crate test;
extern crate lwkt; extern crate fringe;
use lwkt::Context; use fringe::Context;
static mut ctx_slot: *mut Context<'static, lwkt::OsStack> = 0 as *mut Context<_>; static mut ctx_slot: *mut Context<'static, fringe::OsStack> = 0 as *mut Context<_>;
#[bench] #[bench]
fn swap(b: &mut test::Bencher) { fn swap(b: &mut test::Bencher) {
unsafe { unsafe {
let stack = lwkt::OsStack::new(4 << 20).unwrap(); let stack = fringe::OsStack::new(4 << 20).unwrap();
let mut ctx = Context::new(stack, move || { let mut ctx = Context::new(stack, move || {
let ctx_ptr = ctx_slot; let ctx_ptr = ctx_slot;

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
extern crate gcc; extern crate gcc;

View File

@ -1,13 +1,16 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution.
#![feature(thread_local)] #![feature(thread_local)]
extern crate lwkt; extern crate fringe;
use lwkt::Context; use fringe::Context;
#[thread_local] #[thread_local]
static mut ctx_slot: *mut Context<'static, lwkt::OsStack> = 0 as *mut Context<_>; static mut ctx_slot: *mut Context<'static, fringe::OsStack> = 0 as *mut Context<_>;
fn main() { fn main() {
unsafe { unsafe {
let stack = lwkt::OsStack::new(4 << 20).unwrap(); let stack = fringe::OsStack::new(4 << 20).unwrap();
let mut ctx = Context::new(stack, move || { let mut ctx = Context::new(stack, move || {
println!("it's alive!"); println!("it's alive!");

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
use core::prelude::*; use core::prelude::*;

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
use core::prelude::*; use core::prelude::*;

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
use core::prelude::*; use core::prelude::*;

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
use core::prelude::*; use core::prelude::*;

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
use core::prelude::*; use core::prelude::*;

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
pub use self::imp::*; pub use self::imp::*;

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
#![feature(no_std)] #![feature(no_std)]

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
use core::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering}; use core::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
extern crate libc; extern crate libc;

View File

@ -1,3 +1,4 @@
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
//! Traits for stacks. //! Traits for stacks.