about summary refs log tree commit diff
path: root/src/libstd/unstable
AgeCommit message (Collapse)AuthorLines
2014-01-07std: Fill in all missing importsAlex Crichton-0/+3
Fallout from the previous commits
2014-01-07auto merge of #11348 : alexcrichton/rust/snapshots, r=brsonbors-2/+2
2014-01-06Remove some unnecessary type castsFlorian Hahn-2/+2
Conflicts: src/librustc/middle/lint.rs
2014-01-06Register new snapshotsAlex Crichton-2/+2
2014-01-03fixup! libstd: Always inline all byteswap functionsCarl-Anton Ingmarsson-27/+27
2014-01-02libstd: Always inline all byteswap functionsCarl-Anton Ingmarsson-27/+27
2014-01-01Add byteswap intrinsics for converting from big/little to host endianCarl-Anton Ingmarsson-0/+13
These are similar to the ntoh[s|l] functions in C and have the style of from_[be|le][16|32|64].
2013-12-31auto merge of #11187 : alexcrichton/rust/once, r=brsonbors-1/+148
Rationale can be found in the first commit, but this is basically the same thing as `pthread_once`
2013-12-31Convert relevant static mutexes to OnceAlex Crichton-10/+13
2013-12-31Implement volatile_load and volatile_store intrinsics.Peter Zotov-0/+12
2013-12-29Actually block in a windows cvarAlex Crichton-1/+1
Turns out with an argument of 0 the function always returns immediately! Closes #11003
2013-12-28Implement a Once primitive for initializationAlex Crichton-1/+145
Of the 8 static mutexes that are currently in-use by the compiler and its libraries, 4 of them are currently used for one-time initialization. The unforunate side effect of using a static mutex is that the mutex is leaked. This primitive should provide the basis for efficiently keeping track of one-time initialization as well as ensuring that it does not leak the internal mutex that is used. I have chosen to put this in libstd because libstd is currently making use of a static initialization mutex (rt::local_ptr), but I can also see a more refined version of this type being suitable to initialize FFI bindings (such as initializing LLVM and initializing winsock networking on windows). I also intend on adding "helper threads" to libnative, and those will greatly benefit from a simple "once" primitive rather than always reinventing the wheel by using mutexes and bools. I would much rather see this primitive built on a mutex that blocks green threads appropriately, but that does not exist at this time, so it does not belong outside of `std::unstable`.
2013-12-25Test fixes and rebase conflictsAlex Crichton-0/+2
* vec::raw::to_ptr is gone * Pausible => Pausable * Removing @ * Calling the main task "<main>" * Removing unused imports * Removing unused mut * Bringing some libextra tests up to date * Allowing compiletest to work at stage0 * Fixing the bootstrap-from-c rmake tests * assert => rtassert in a few cases * printing to stderr instead of stdout in fail!()
2013-12-24std: Get stdtest all passing againAlex Crichton-8/+6
This commit brings the library up-to-date in order to get all tests passing again
2013-12-24green: Rip the bandaid off, introduce libgreenAlex Crichton-15/+2
This extracts everything related to green scheduling from libstd and introduces a new libgreen crate. This mostly involves deleting most of std::rt and moving it to libgreen. Along with the movement of code, this commit rearchitects many functions in the scheduler in order to adapt to the fact that Local::take now *only* works on a Task, not a scheduler. This mostly just involved threading the current green task through in a few locations, but there were one or two spots where things got hairy. There are a few repercussions of this commit: * tube/rc have been removed (the runtime implementation of rc) * There is no longer a "single threaded" spawning mode for tasks. This is now encompassed by 1:1 scheduling + communication. Convenience methods have been introduced that are specific to libgreen to assist in the spawning of pools of schedulers.
2013-12-24std: Introduce std::syncAlex Crichton-1087/+6
For now, this moves the following modules to std::sync * UnsafeArc (also removed unwrap method) * mpsc_queue * spsc_queue * atomics * mpmc_bounded_queue * deque We may want to remove some of the queues, but for now this moves things out of std::rt into std::sync
2013-12-24std: Introduce an unstable::stack moduleAlex Crichton-0/+274
This module will be used to manage the OS-specific TLS registers used to specify the bounds of the current rust stack (useful in 1:1 and M:N)
2013-12-16Fallout of rewriting std::commAlex Crichton-24/+12
2013-12-15std: fix spelling in docs.Huon Wilson-1/+1
2013-12-12Inline Finallyalizer::drop, allowing LLVM to optimize `finally`.Eduard Burtescu-0/+1
* fixes the vec::from_elem regression caused by #8780 * added 5 benchmarks for allocating a 1KB ~[u8] and zeroing it
2013-12-11Make 'self lifetime illegal.Erik Price-7/+7
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-10libstd: Change `atomically` to use RAII.Patrick Walton-43/+71
2013-12-10libstd: Remove `Cell`s that were used because of `finally` by convertingPatrick Walton-27/+42
their `finally` blocks to RAII.
2013-12-10libextra: Another round of de-`Cell`-ing.Patrick Walton-3/+1
34 uses of `Cell` remain.
2013-12-08Remove dead codesKiet Tran-0/+1
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-1/+1
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-12-03Move std::util::ignore to std::prelude::dropSteven Fackler-4/+3
It's a more fitting name for the most common use case of this function.
2013-12-03auto merge of #10747 : alexcrichton/rust/snapshots, r=cmrbors-4/+0
This registers new snapshots after the landing of #10528, and then goes on to tweak the build process to build a monolithic `rustc` binary for use in future snapshots. This mainly involved dropping the dynamic dependency on `librustllvm`, so that's now built as a static library (with a dynamically generated rust file listing LLVM dependencies). This currently doesn't actually make the snapshot any smaller (24MB => 23MB), but I noticed that the executable has 11MB of metadata so once progress is made on #10740 we should have a much smaller snapshot. There's not really a super-compelling reason to distribute just a binary because we have all the infrastructure for dealing with a directory structure, but to me it seems "more correct" that a snapshot compiler is just a `rustc` binary.
2013-12-03Register new snapshotsAlex Crichton-4/+0
2013-12-01auto merge of #10756 : thestinger/rust/transmute, r=alexcrichtonbors-1/+1
2013-12-01remove useless `transmute_immut` functionDaniel Micay-1/+1
2013-11-30Wrap the return value of the type_id intrinsic in an opaque boxCorey Richardson-1/+24
Closes #10594
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-1/+1
2013-11-28Register new snapshotsAlex Crichton-2/+1
2013-11-26librustc: Fix merge fallout.Patrick Walton-2/+2
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-10/+10
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-57/+36
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-2/+2
2013-11-25Move LittleLock to using RAIIAlex Crichton-71/+71
This moves the locking/waiting methods to returning an RAII struct instead of relying on closures. Additionally, this changes the methods to all take '&mut self' to discourage recursive locking. The new method to block is to call `wait` on the returned RAII structure instead of calling it on the lock itself (this enforces that the lock is held). At the same time, this improves the Mutex interface a bit by allowing destruction of non-initialized members and by allowing construction of an empty mutex (nothing initialized inside).
2013-11-24auto merge of #10603 : alexcrichton/rust/no-linked-failure, r=brsonbors-83/+59
The reasons for doing this are: * The model on which linked failure is based is inherently complex * The implementation is also very complex, and there are few remaining who fully understand the implementation * There are existing race conditions in the core context switching function of the scheduler, and possibly others. * It's unclear whether this model of linked failure maps well to a 1:1 threading model Linked failure is often a desired aspect of tasks, but we would like to take a much more conservative approach in re-implementing linked failure if at all. Closes #8674 Closes #8318 Closes #8863
2013-11-24Remove linked failure from the runtimeAlex Crichton-83/+59
The reasons for doing this are: * The model on which linked failure is based is inherently complex * The implementation is also very complex, and there are few remaining who fully understand the implementation * There are existing race conditions in the core context switching function of the scheduler, and possibly others. * It's unclear whether this model of linked failure maps well to a 1:1 threading model Linked failure is often a desired aspect of tasks, but we would like to take a much more conservative approach in re-implementing linked failure if at all. Closes #8674 Closes #8318 Closes #8863
2013-11-22add a breakpoint intrinsic for debuggingDaniel Micay-0/+4
This can be used to grab the attention of a debugger, and unlike `abort` execution can be resumed.
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-17/+16
2013-11-18auto merge of #10561 : pcwalton/rust/procify, r=alexcrichtonbors-11/+1
r? @alexcrichton
2013-11-18Remove the C++ lock_and_signal typeAlex Crichton-32/+21
A the same time this purges all runtime support needed for statically initialized mutexes, moving all users over to the new Mutex type instead.
2013-11-18Implement a native mutex typeAlex Crichton-0/+337
This mutex is built on top of pthreads for unix and the related windows apis on windows. This is a straight port of the lock_and_signal type from C++ to rust. Almost all operations on the type are unsafe, and it's definitely not recommended for general use. Closes #9105
2013-11-18libstd: Change all `~fn()`s to `proc`s in the standard library.Patrick Walton-11/+1
This makes `Cell`s no longer necessary in most cases.
2013-11-13add rust_trylock_little_lockJason Toffaletti-1/+16
Try to acquire lock and succeed only if lock is not already held. Uses TryEnterCriticalSection or pthread_mutex_trylock.
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-33/+8
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-11-11auto merge of #10394 : yichoi/rust/make_check_pass_android, r=brsonbors-0/+1
To enable test on android bot #9120 some tests are disabled and can be fixed further.