about summary refs log tree commit diff
path: root/src/libstd/unstable
AgeCommit message (Collapse)AuthorLines
2014-02-23std: Move intrinsics to std::intrinsics.Brian Anderson-459/+1
Issue #1457
2014-02-17Made fail_bounds_check more careful with strings.chromatic-2/+12
Fixes GH #11976.
2014-02-15auto merge of #12298 : alexcrichton/rust/rustdoc-testing, r=sfacklerbors-4/+10
It's too easy to forget the `rust` tag to test something. Closes #11698
2014-02-16std::unstable::mutex: streamline & clarify documentation.Huon Wilson-26/+37
2014-02-16std: add a NativeMutex type as a wrapper to destroy StaticNativeMutex.Huon Wilson-65/+107
This obsoletes LittleLock, and so it is removed.
2014-02-16std: Rename unstable::mutex::Mutex to StaticNativeMutex.Huon Wilson-38/+42
This better reflects its purpose and design.
2014-02-16std: add tests for the _noguard lock/signal/wait methods on Mutex.Huon Wilson-2/+28
2014-02-16std: add an RAII unlocker to Mutex.Huon Wilson-36/+96
This automatically unlocks its lock when it goes out of scope, and provides a safe(ish) method to call .wait.
2014-02-14Fix all code examplesAlex Crichton-4/+10
2014-02-13Remove two allocations from spawning a green taskAlex Crichton-0/+6
Two unfortunate allocations were wrapping a proc() in a proc() with GreenTask::build_start_wrapper, and then boxing this proc in a ~proc() inside of Context::new(). Both of these allocations were a direct result from two conditions: 1. The Context::new() function has a nice api of taking a procedure argument to start up a new context with. This inherently required an allocation by build_start_wrapper because extra code needed to be run around the edges of a user-provided proc() for a new task. 2. The initial bootstrap code only understood how to pass one argument to the next function. By modifying the assembly and entry points to understand more than one argument, more information is passed through in registers instead of allocating a pointer-sized context. This is sadly where I end up throwing mips under a bus because I have no idea what's going on in the mips context switching code and don't know how to modify it. Closes #7767 cc #11389
2014-02-13Register new snapshotsAlex Crichton-25/+0
2014-02-12Removed ty_type (previously used to represent *tydesc).Eduard Burtescu-0/+3
2014-02-11std -- replaces uses where const borrows would be requiredNiko Matsakis-35/+79
2014-02-09std: Move byteswap functions to memBrian Anderson-27/+0
2014-02-09std: Add init and uninit to mem. Replace direct intrinsic usageBrian Anderson-5/+4
2014-02-08auto merge of #12096 : brson/rust/morestack-addr, r=thestingerbors-3/+0
2014-02-07rm out-of-date comment from std::unstable::rawDaniel Micay-3/+0
2014-02-07remove type descriptors from proc and @TDaniel Micay-0/+20
This also drops support for the managed pointer POISON_ON_FREE feature as it's not worth adding back the support for it. After a snapshot, the leftovers can be removed.
2014-02-07rustc: Remove 'morestack_addr' intrinsic. UnusedBrian Anderson-3/+0
2014-02-05libstd: Add missing constants for arm/linux.Luqman Aden-1/+5
2014-02-05Implement clone() for TCP/UDP/Unix socketsAlex Crichton-1/+0
This is part of the overall strategy I would like to take when approaching issue #11165. The only two I/O objects that reasonably want to be "split" are the network stream objects. Everything else can be "split" by just creating another version. The initial idea I had was the literally split the object into a reader and a writer half, but that would just introduce lots of clutter with extra interfaces that were a little unnnecssary, or it would return a ~Reader and a ~Writer which means you couldn't access things like the remote peer name or local socket name. The solution I found to be nicer was to just clone the stream itself. The clone is just a clone of the handle, nothing fancy going on at the kernel level. Conceptually I found this very easy to wrap my head around (everything else supports clone()), and it solved the "split" problem at the same time. The cloning support is pretty specific per platform/lib combination: * native/win32 - uses some specific WSA apis to clone the SOCKET handle * native/unix - uses dup() to get another file descriptor * green/all - This is where things get interesting. When we support full clones of a handle, this implies that we're allowing simultaneous writes and reads to happen. It turns out that libuv doesn't support two simultaneous reads or writes of the same object. It does support *one* read and *one* write at the same time, however. Some extra infrastructure was added to just block concurrent writers/readers until the previous read/write operation was completed. I've added tests to the tcp/unix modules to make sure that this functionality is supported everywhere.
2014-02-04Register new snapshotsAlex Crichton-120/+0
2014-02-03std: Hardcode pthread constants and structuresAlex Crichton-300/+217
This allows for easier static initialization of a pthread mutex, although the windows mutexes still sadly suffer. Note that this commit removes the clone() method from a mutex because it no longer makes sense for pthreads mutexes. This also removes the Once type for now, but it'll get added back shortly.
2014-02-03Add an AtomicU64 type to std::sync::atomicsAlex Crichton-9/+101
This also generalizes all atomic intrinsics over T so we'll be able to add u8 atomics if we really feel the need to (do we really want to?)
2014-02-03std: Fix tests with io_error usageAlex Crichton-1/+1
2014-02-02std,extra: remove use of & support for @[].Huon Wilson-1/+0
2014-02-02libextra: Remove `@str` from all the librariesPatrick Walton-1/+0
2014-01-31Retry on EINVAL from pthread_attr_setstacksize()Ben Noordhuis-1/+1
Enforce that the stack size is > RED_ZONE + PTHREAD_STACK_MIN. If the call to pthread_attr_setstacksize() subsequently fails with EINVAL, it means that the platform requires the stack size to be a multiple of the page size. In that case, round up to the nearest page and retry. Fixes #11694.
2014-01-29Removing do keyword from libstd and librustcScott Lawrence-12/+12
2014-01-28Feature gate #[simd]David Manescu-0/+10
Fixes #11721
2014-01-27Removed take_glue from tydesc, inlining the equivalent refcount increment ↵Eduard Burtescu-0/+2
code instead.
2014-01-27Demote self to an (almost) regular argument and remove the env param.Eduard Burtescu-1/+3
Fixes #10667 and closes #10259.
2014-01-25Uppercase numeric constantsChris Wong-4/+4
The following are renamed: * `min_value` => `MIN` * `max_value` => `MAX` * `bits` => `BITS` * `bytes` => `BYTES` Fixes #10010.
2014-01-22libc: switch `free` to the proper signatureDaniel Micay-20/+20
This does not attempt to fully propagate the mutability everywhere, but gives new code a hint to avoid the same issues.
2014-01-22Replace C types with Rust types in libstd, closes #7313Florian Hahn-56/+52
2014-01-21Purge borrowck from libstdAlex Crichton-40/+0
This hasn't been in use since `@mut` was removed
2014-01-17handle zero-size allocations correctlyDaniel Micay-8/+5
The `malloc` family of functions may return a null pointer for a zero-size allocation, which should not be interpreted as an out-of-memory error. If the implementation does not return a null pointer, then handling this will result in memory savings for zero-size types. This also switches some code to `malloc_raw` in order to maintain a centralized point for handling out-of-memory in `rt::global_heap`. Closes #11634
2014-01-17auto merge of #11585 : nikomatsakis/rust/issue-3511-rvalue-lifetimes, r=pcwaltonbors-6/+0
Major changes: - Define temporary scopes in a syntax-based way that basically defaults to the innermost statement or conditional block, except for in a `let` initializer, where we default to the innermost block. Rules are documented in the code, but not in the manual (yet). See new test run-pass/cleanup-value-scopes.rs for examples. - Refactors Datum to better define cleanup roles. - Refactor cleanup scopes to not be tied to basic blocks, permitting us to have a very large number of scopes (one per AST node). - Introduce nascent documentation in trans/doc.rs covering datums and cleanup in a more comprehensive way. r? @pcwalton
2014-01-15auto merge of #11565 : mozilla/rust/snapshot, r=huonwbors-38/+1
2014-01-15Issue #3511 - Rationalize temporary lifetimes.Niko Matsakis-6/+0
Major changes: - Define temporary scopes in a syntax-based way that basically defaults to the innermost statement or conditional block, except for in a `let` initializer, where we default to the innermost block. Rules are documented in the code, but not in the manual (yet). See new test run-pass/cleanup-value-scopes.rs for examples. - Refactors Datum to better define cleanup roles. - Refactor cleanup scopes to not be tied to basic blocks, permitting us to have a very large number of scopes (one per AST node). - Introduce nascent documentation in trans/doc.rs covering datums and cleanup in a more comprehensive way.
2014-01-15auto merge of #11561 : eddyb/rust/moar-inlines, r=pcwaltonbors-0/+2
2014-01-15register snapshotsDaniel Micay-38/+1
2014-01-15libstd: Added more #[inline] annotations and replaced uses of `libc::abort` ↵Eduard Burtescu-0/+2
with the intrinsic.
2014-01-14add implementation of `Repr` for `~[T]`Daniel Micay-0/+1
2014-01-14remove `borrow_offset` as ~ is now free of headersDaniel Micay-7/+0
2014-01-14remove reference counting headers from ~Daniel Micay-0/+2
Unique pointers and vectors currently contain a reference counting header when containing a managed pointer. This `{ ref_count, type_desc, prev, next }` header is not necessary and not a sensible foundation for tracing. It adds needless complexity to library code and is responsible for breakage in places where the branch has been left out. The `borrow_offset` field can now be removed from `TyDesc` along with the associated handling in the compiler. Closes #9510 Closes #11533
2014-01-11Removed free_glue from tydesc (the code is still generated, but inlined in ↵Eduard Burtescu-2/+31
drop_glue).
2014-01-07extratest: Fix all leaked trait importsAlex Crichton-1/+2
2014-01-07stdtest: Fix all leaked trait importsAlex Crichton-2/+0
2014-01-07Fix remaining cases of leaking importsAlex Crichton-2/+5