summary refs log tree commit diff
path: root/src/libgreen/context.rs
AgeCommit message (Collapse)AuthorLines
2014-09-30Fix libgreenSteven Fackler-10/+7
2014-08-26DST coercions and DST structsNick Cameron-1/+1
[breaking-change] 1. The internal layout for traits has changed from (vtable, data) to (data, vtable). If you were relying on this in unsafe transmutes, you might get some very weird and apparently unrelated errors. You should not be doing this! Prefer not to do this at all, but if you must, you should use raw::TraitObject rather than hardcoding rustc's internal representation into your code. 2. The minimal type of reference-to-vec-literals (e.g., `&[1, 2, 3]`) is now a fixed size vec (e.g., `&[int, ..3]`) where it used to be an unsized vec (e.g., `&[int]`). If you want the unszied type, you must explicitly give the type (e.g., `let x: &[_] = &[1, 2, 3]`). Note in particular where multiple blocks must have the same type (e.g., if and else clauses, vec elements), the compiler will not coerce to the unsized type without a hint. E.g., `[&[1], &[1, 2]]` used to be a valid expression of type '[&[int]]'. It no longer type checks since the first element now has type `&[int, ..1]` and the second has type &[int, ..2]` which are incompatible. 3. The type of blocks (including functions) must be coercible to the expected type (used to be a subtype). Mostly this makes things more flexible and not less (in particular, in the case of coercing function bodies to the return type). However, in some rare cases, this is less flexible. TBH, I'm not exactly sure of the exact effects. I think the change causes us to resolve inferred type variables slightly earlier which might make us slightly more restrictive. Possibly it only affects blocks with unreachable code. E.g., `if ... { fail!(); "Hello" }` used to type check, it no longer does. The fix is to add a semicolon after the string.
2014-08-20Stage #[repr(packed)] in std::rtCorey Richardson-6/+6
2014-08-20libgreen: use FFI-safe typesCorey Richardson-29/+32
2014-08-05Renamed `record_stack_bounds` for clarity.Vadim Chugunov-2/+2
For a good measure, implemented target_record_stack_bounds for 32-bit Windows as well.
2014-08-04libnative should not mess with stack limits in the TIB. Only libgreen has a ↵Vadim Chugunov-2/+2
legitimate need to set them.
2014-08-04Ensure that Registers struct is 16-byte aligned on x86_64.Vadim Chugunov-11/+29
This is important when building with --disable-jemalloc: unlike jemalloc, msvcrt does not align on 16 bytes unless asked to.
2014-06-28Rename all raw pointers as necessaryAlex Crichton-4/+4
2014-06-24Added Mipsel architecture supportPawel Olzacki-0/+3
2014-06-11rustc: Remove ~[T] from the languageAlex Crichton-2/+2
The following features have been removed * box [a, b, c] * ~[a, b, c] * box [a, ..N] * ~[a, ..N] * ~[T] (as a type) * deprecated_owned_vector lint All users of ~[T] should move to using Vec<T> instead.
2014-06-10auto merge of #14764 : jbcrail/rust/fix-more-comments, r=alexcrichtonbors-1/+1
2014-06-10Fix more misspelled comments and strings.Joseph Crail-1/+1
2014-06-08Mark relevant structs with repr(C)Jakub Wieczorek-0/+1
2014-05-28fix MIPS targetJyun-Yan You-1/+1
2014-05-11core: Remove the cast moduleAlex Crichton-2/+2
This commit revisits the `cast` module in libcore and libstd, and scrutinizes all functions inside of it. The result was to remove the `cast` module entirely, folding all functionality into the `mem` module. Specifically, this is the fate of each function in the `cast` module. * transmute - This function was moved to `mem`, but it is now marked as #[unstable]. This is due to planned changes to the `transmute` function and how it can be invoked (see the #[unstable] comment). For more information, see RFC 5 and #12898 * transmute_copy - This function was moved to `mem`, with clarification that is is not an error to invoke it with T/U that are different sizes, but rather that it is strongly discouraged. This function is now #[stable] * forget - This function was moved to `mem` and marked #[stable] * bump_box_refcount - This function was removed due to the deprecation of managed boxes as well as its questionable utility. * transmute_mut - This function was previously deprecated, and removed as part of this commit. * transmute_mut_unsafe - This function doesn't serve much of a purpose when it can be achieved with an `as` in safe code, so it was removed. * transmute_lifetime - This function was removed because it is likely a strong indication that code is incorrect in the first place. * transmute_mut_lifetime - This function was removed for the same reasons as `transmute_lifetime` * copy_lifetime - This function was moved to `mem`, but it is marked `#[unstable]` now due to the likelihood of being removed in the future if it is found to not be very useful. * copy_mut_lifetime - This function was also moved to `mem`, but had the same treatment as `copy_lifetime`. * copy_lifetime_vec - This function was removed because it is not used today, and its existence is not necessary with DST (copy_lifetime will suffice). In summary, the cast module was stripped down to these functions, and then the functions were moved to the `mem` module. transmute - #[unstable] transmute_copy - #[stable] forget - #[stable] copy_lifetime - #[unstable] copy_mut_lifetime - #[unstable] [breaking-change]
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-11/+11
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-5/+5
2014-04-19green: Fix missing Send bounds on proceduresAlex Crichton-1/+1
These were mistakenly not updated as part of the removal of the Send bound by default on procedures. cc #13629
2014-03-31green: Switch field privacy as necessaryAlex Crichton-2/+2
2014-03-14fix MIPS targetJyun-Yan You-0/+2
I ignored AtomicU64 methods on MIPS target because libgcc doesn't implement MIPS32 64-bit atomic operations. Otherwise it would cause link failure.
2014-02-24green,native,rustuv: Replace many pointer `transmute`'s with `as` or ↵Huon Wilson-5/+2
referencing. These can all be written in a more controlled manner than with the transmute hammer, leading to (hopefully) safer code.
2014-02-24green: remove ancient register-saving code.Huon Wilson-6/+1
@alexcrichton said he thought this was useless (and it's old logic: it's been there since before the runtime was written into Rust).
2014-02-23std: Move unstable::stack to rt::stackBrian Anderson-1/+1
2014-02-23std: Move raw to std::rawBrian Anderson-1/+1
Issue #1457
2014-02-13Remove two allocations from spawning a green taskAlex Crichton-53/+60
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-01-26auto merge of #11762 : alexcrichton/rust/guard_pages, r=alexcrichtonbors-3/+3
Rebasing of the previous PRs, I believe I've found the problems.
2014-01-25Uppercase numeric constantsChris Wong-2/+2
The following are renamed: * `min_value` => `MIN` * `max_value` => `MAX` * `bits` => `BITS` * `bytes` => `BYTES` Fixes #10010.
2014-01-24Use `mmap` to map in task stacks and guard pageCorey Richardson-3/+3
Also implement caching of stacks.
2013-12-24rustuv: Fix a memory leak (documented inside)Alex Crichton-7/+25
This happened because the environment of a procedure was never deallocated.
2013-12-24green: Rip the bandaid off, introduce libgreenAlex Crichton-0/+284
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.