Commit Graph

10 Commits

Author SHA1 Message Date
Huon Wilson
8b246fda78 green,native,rustuv: Replace many pointer transmute's with as or referencing.
These can all be written in a more controlled manner than with the
transmute hammer, leading to (hopefully) safer code.
2014-02-24 01:15:39 +11:00
Huon Wilson
768b96e8b1 green: remove ancient register-saving code.
@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-24 00:57:35 +11:00
Brian Anderson
db111846b5 std: Move unstable::stack to rt::stack 2014-02-23 01:47:08 -08:00
Brian Anderson
3e57808a01 std: Move raw to std::raw
Issue #1457
2014-02-23 01:07:53 -08:00
Alex Crichton
301ff0c2df Remove two allocations from spawning a green task
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-13 20:31:17 -08:00
bors
838b5a4cc0 auto merge of #11762 : alexcrichton/rust/guard_pages, r=alexcrichton
Rebasing of the previous PRs, I believe I've found the problems.
2014-01-26 00:51:35 -08:00
Chris Wong
988e4f0a1c Uppercase numeric constants
The following are renamed:

* `min_value` => `MIN`
* `max_value` => `MAX`
* `bits` => `BITS`
* `bytes` => `BYTES`

Fixes #10010.
2014-01-25 21:38:25 +13:00
Corey Richardson
dee7fa58dd Use mmap to map in task stacks and guard page
Also implement caching of stacks.
2014-01-24 22:30:00 -08:00
Alex Crichton
9f005866e5 rustuv: Fix a memory leak (documented inside)
This happened because the environment of a procedure was never deallocated.
2013-12-24 19:59:54 -08:00
Alex Crichton
51abdee5f1 green: Rip the bandaid off, introduce libgreen
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-24 19:59:52 -08:00