rust/src/rt/arch
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
..
arm Remove two allocations from spawning a green task 2014-02-13 20:31:17 -08:00
i386 rt: Namespace all C functions under rust_ 2013-11-18 16:17:43 -08:00
mips rt: Namespace all C functions under rust_ 2013-11-18 16:17:43 -08:00
x86_64 Remove two allocations from spawning a green task 2014-02-13 20:31:17 -08:00