Commit Graph

1531 Commits

Author SHA1 Message Date
Brian Anderson
b9608fe423 std: Convert uv_global_loop to use pipes 2013-01-23 17:35:34 -08:00
Brian Anderson
fb9299346a core: Convert getenv/setenv to use a mutex
This much simpler implementation uses a global mutex
and eliminates the kernel environment channel.
2013-01-23 17:35:34 -08:00
Brian Anderson
8852279a9e core: Add new weak task API 2013-01-23 17:35:31 -08:00
Brian Anderson
6b6acde972 Add a license check to tidy. #4018 2013-01-17 23:28:42 -08:00
Brian Anderson
db1abbec4c core: Add private global data interface. #3915 2013-01-17 19:24:50 -08:00
Brian Anderson
ac435af73a Add at_exit function #4450 2013-01-15 18:00:19 -08:00
Brian Anderson
090b247056 Spawn new tasks onto the primary scheduler by default. #3760 2013-01-15 18:00:19 -08:00
Brian Anderson
3d54187890 Win32 build fix 2013-01-13 16:43:39 -08:00
ILyoan
4fb4be8f17 More android support
Conflicts:
	Makefile.in
	cmakeFiles/rustllvm.cmake
2013-01-13 16:43:39 -08:00
kyeongwoon
987f824f23 Support ARM and Android
Conflicts:
	src/libcore/os.rs
	src/librustc/back/link.rs
	src/librustc/driver/driver.rs
	src/librustc/metadata/loader.rs
	src/librustc/middle/trans/base.rs
2013-01-13 16:43:39 -08:00
Brian Anderson
1b1700f44b Add core::private::run_in_bare_thread
This begins executing Rust code in a fresh context with no runtime environment
2013-01-11 14:53:28 -08:00
Brian Anderson
6a2e495d67 rt: Remove unused command line parsing 2013-01-09 15:26:15 -08:00
Brian Anderson
b43e639bf6 Remove unused bigint from runtime 2013-01-08 13:53:45 -08:00
Patrick Walton
6c18c75f2d rt: Stop zeroing out all allocations. Unobservable perf win. Closes #2682. rs=negligible-perf-win 2013-01-05 18:04:29 -08:00
Chris Peterson
e08f304b81 rt: Remove dead code from schedule_task() 2012-12-30 23:12:24 -08:00
Brian Anderson
7f8e302a6a Whitespace 2012-12-15 23:03:45 -08:00
Brian Anderson
20ea37b336 rt: Do some casting to avoid warnings 2012-12-15 22:38:20 -08:00
Brian Anderson
91067e9df4 Long lines 2012-12-15 22:38:20 -08:00
Jesse Jones
81805e0568 Check for oom in a few more places 2012-12-15 22:38:20 -08:00
Jesse Jones
0402360abb Abort instead of throwing on oom 2012-12-15 22:38:20 -08:00
Jesse Jones
e8d2d55900 Made a bunch more classes non-copyable 2012-12-15 22:38:20 -08:00
Jesse Jones
eca23da98b Instead of returning a bool (which everyone ignored) pop asserts 2012-12-15 22:38:20 -08:00
Jesse Jones
6bab226fc5 Check for realloc failure and bad subscripts 2012-12-15 22:38:20 -08:00
Jesse Jones
cf1c3d2da0 polymorphic indexed_list fixes:
1) indexed_list no longer has virtual methods. It's not actually subclassed
and there is very rarely good reason to subclass collection classes.
2) Added a virtual dtor to indexed_list_object which is intended to be
subclassed. This allows derived dtors to be called if the object is
deleted with a indexed_list_object*.
2012-12-15 22:38:20 -08:00
Jesse Jones
fc740a7297 Improvements to array_list, hash_map, and indexed_list:
* Disabled copying.
* Added const where appropiate.
2012-12-15 22:38:19 -08:00
Graydon Hoare
12c32e944d Add license boilerplate to more files. 2012-12-10 17:32:58 -08:00
Tim Chevalier
0027874218 Remove bogus FIXME, closes #2889 2012-12-06 16:14:54 -08:00
Graydon Hoare
00c856c0b1 Update license, add license boilerplate to most files. Remainder will follow. 2012-12-03 17:12:14 -08:00
Brian Anderson
aee0b767bc Add a FIXME about the problems closing /dev/urandom 2012-11-26 12:54:29 -08:00
Jesse Jones
065d642b15 Log errors from close instead of ignoring them.
They shouldn't matter but there have been errors on Macs so logging
them may help root cause the issue.
2012-11-26 12:54:29 -08:00
Jesse Jones
8adacc06aa Some isaac_ssed fixes:
1) Check for eof (shouldn't happen, but if it does we'll fall into an
infinite loop).
2) Use fatal instead of assert (will work if NDEBUG is ever defined
and provides better diagnostics).
3) Ignore errors from close since they shouldn't matter.

Closes #3679.
2012-11-26 12:54:29 -08:00
Brian Anderson
187c6c90a1 rt: Don't print backtraces unless the ::rt::backtrace log level is greater than log_err 2012-11-15 15:14:30 -08:00
Graydon Hoare
59a034a63f rt: bump log levels up by one, fix tautological-compare error (and permit turning off logging entirely). 2012-11-15 12:03:54 -08:00
Brian Anderson
53ec6c3f9b rt: Remove shape code 2012-11-05 15:22:35 -08:00
Brian Anderson
1b0c6665d9 Merge remote-tracking branch 'brson/repl'
Conflicts:
	mk/install.mk
	src/rt/rustrt.def.in
2012-11-04 13:42:39 -08:00
Brian Anderson
799eb105b9 Use a linenoise with win32 support 2012-11-04 13:34:14 -08:00
Zack Corr
ea996556b9 rusti: Remove linenoise module, add to rt, remove core::rl 2012-10-30 11:08:36 +10:00
Brian Anderson
759e1c165f rt: Remove unused string upcalls harder 2012-10-23 13:48:09 -07:00
Brian Anderson
8d932160d9 rt: Remove box annihilator 2012-10-23 12:14:46 -07:00
Brian Anderson
a469a3524d rt: Remove unused string upcalls 2012-10-23 12:14:45 -07:00
Luqman Aden
48582b360c Replace rust_atomic_increment/decrement and rust_compare_and_swap_ptr with intrinsics. 2012-10-21 22:43:28 -04:00
Brian Anderson
55e40a1674 Add new uv functions to rustrt.def.in 2012-10-20 17:41:34 -07:00
Luqman Aden
0e2437bf5d uv: implement a way to get client's ip/port. 2012-10-20 17:17:10 -07:00
Brian Anderson
2d5cac960d rt: Remove check_claims from the export list 2012-10-04 15:41:14 -07:00
Brian Anderson
738cd00f1d rt: Remove CHECK_CLAIMS 2012-10-04 14:10:45 -07:00
Graydon Hoare
365f174838 Attempt to fix os::args errors on various platforms. 2012-10-03 15:02:22 -07:00
Patrick Walton
9284179311 libstd: Switch off legacy modes in both core and std. 2012-10-02 12:20:06 -07:00
Brian Anderson
6bb0399df2 rt: Check the results of pthread calls
The stage0 compiler is not working on an x86_64 debian wheezy instance and it
looks like maye pthread_create is failing
2012-09-29 16:29:47 -07:00
Patrick Walton
f41c53667e rustc: Fix calls to the logging function when the must_cast flag is true; stop using shape code for logging 2012-09-25 14:56:17 -07:00
Patrick Walton
ee7fa194fa Revert "rustc: Stop using shape code for logging" due to ICEs
This reverts commit ac822a52be.
2012-09-25 12:17:05 -07:00
Patrick Walton
f813f519a5 rt: Remove the cycle collector 2012-09-25 12:13:20 -07:00
Patrick Walton
ac822a52be rustc: Stop using shape code for logging 2012-09-25 11:44:23 -07:00
Patrick Walton
dbc00ced3a rt: Add a logging function for strings (only).
This will be the shape-free replacement for upcall_log_type.
2012-09-24 20:26:06 -07:00
Patrick Walton
00e3492511 rt: Call the Rust box annihilator; stop calling the cycle collector
This reverts commit 991cbfe42c.
2012-09-24 20:25:56 -07:00
Patrick Walton
991cbfe42c Revert "rt: Call the Rust box annihilator; stop calling the cycle collector" due to crashes
This reverts commit bb0ad11252.
2012-09-24 14:14:03 -07:00
Patrick Walton
bb0ad11252 rt: Call the Rust box annihilator; stop calling the cycle collector 2012-09-24 13:57:48 -07:00
Patrick Walton
3c2b6110dd rustc: Shove the address of the box annihilator into the crate map 2012-09-21 11:42:57 -07:00
Philipp Brüschweiler
d3e0a06578 V2: now with more locks! 2012-09-19 14:01:53 -07:00
Philipp Brüschweiler
68e755b1c2 core: Allocate threads on demand, not on scheduler startup
API change: rust_kernel::create_scheduler() or
rust_scheduler::rust_scheduler() respecitevly now take ownership of the
launch factory argument, it is needed to create new threads on demand.

Also renames rustrt::sched_threads() to rustrt::rust_sched_threads() for
consistency. Added rustrt::rust_max_sched_threads() to return the
maximal number of scheduled threads of the current scheduler.

Fixes #3493.
2012-09-19 14:01:53 -07:00
Philipp Brüschweiler
62b51d9152 rt: Implement ThreadPerCore scheduling mode
Fixes #3465.
2012-09-13 20:48:33 +02:00
Elliott Slaughter
244b95490b gc: Refactoring. 2012-09-07 09:21:22 -07:00
Elliott Slaughter
8d17308eca rt: Add rust_gc_metadata to rustrt.def.in. 2012-09-07 09:21:22 -07:00
Elliott Slaughter
5637126449 rt: Fix GC metadata for 64-bit systems. 2012-09-07 09:21:22 -07:00
Elliott Slaughter
961bd48724 gc: Fix for GC missing stack frames across segment boundaries. 2012-09-07 09:21:22 -07:00
Elliott Slaughter
3f0d207b32 gc: Add stack walker for new garbage collector.
Safe points are exported in a per-module list via the crate map. A C
runtime call walks the crate map at startup and aggregates the list of
safe points for the program.

Currently the GC doesn't actually deallocate memory on malloc and
free. Adding the GC at this stage is primarily of testing value.

The GC does attempt to clean up exchange heap and stack-allocated
resource on failure.

A result of this patch is that the user now needs to be careful about
what code they write in destructors, because the GC and/or failure
cleanup may need to call destructors. Specifically, calls to malloc
are considered unsafe and may result in infinite loops or segfaults.
2012-09-07 09:21:21 -07:00
Niko Matsakis
5e36a99794 Refactor trans to replace lvalue and friends with Datum.
Also:
- report illegal move/ref combos whether or not ref comes first
- commented out fix for #3387, too restrictive and causes an ICE
2012-09-06 06:11:12 -07:00
Patrick Walton
d155410674 rt: Make the boxed region come earlier in the rust_task structure.
This is so that GC can find it more easily.
2012-09-05 20:08:00 -07:00
Brian Anderson
97bb812238 Add rust_annihilate_box to rustrt.def.in 2012-08-31 16:19:02 -07:00
Brian Anderson
a0de6b6d5f Merge remote-tracking branch 'erickt/incoming' 2012-08-31 16:14:18 -07:00
Elliott Slaughter
f022f566a4 rt: Fix box annihilator to deallocate exchange heap boxes properly. 2012-08-31 15:10:52 -07:00
Elliott Slaughter
f8323ac615 rt: Add interface to box annihilator. 2012-08-31 15:10:52 -07:00
Erick Tryzelaar
628b946186 libcore: rewrite str::reserve in pure rust. 2012-08-30 20:40:52 -07:00
Erick Tryzelaar
7bb65848a1 libcore: Rewrite str::unsafe::push_byte in pure rust. 2012-08-30 20:40:52 -07:00
Erick Tryzelaar
0e1a4a4da2 libcore: rewrite vec::unsafe::from_buf in pure rust 2012-08-30 20:40:52 -07:00
Jed Davis
b043349833 Fix MZ_FORCEINLINE define to work with GCC 4.7.1.
Using just __always_inline__ without inline results in several instances
of "error: always_inline function might not be inlinable".
2012-08-29 01:18:00 -07:00
Graydon Hoare
b769e29680 Compress metadata section. Seems a minor speed win, major space win. 2012-08-28 14:50:39 -07:00
Ben Blum
01866fae4e Document task shutdown protocol and justify its concurrency safety. Close #2696. Close bblum's internship. 2012-08-24 19:59:03 -04:00
Ben Blum
5ba7434cb1 Avoid lifecycle_lock traffic in call_on_rust_stack. (close #3270) 2012-08-24 18:28:26 -04:00
Michael Sullivan
dc107898b2 Fix logging code to not sign extend chars being printed in hex. 2012-08-23 12:48:08 -07:00
Michael Sullivan
5f32e18011 Make std::arena run destructors. Closes #2831. 2012-08-21 17:03:00 -07:00
Ben Blum
47cca22d54 Bypass lifecycle_lock in inhibit_kill/allow_kill for 3% to 5% speedup. Close #3213. 2012-08-21 18:03:41 -04:00
Ben Blum
a076c287de Fix issue-506.rs by adding a void-returning stub in the runtime (close #2957) 2012-08-16 21:07:55 -04:00
Ben Blum
bdbad614ac Remove rust_cond_lock and sys::condition (rename to little_lock) 2012-08-07 18:18:48 -04:00
Eric Holk
9f287c211e Refcount tasks in packets to avoid races.
Revert "Once again, revert "Use pipes in compiletest""

Fixes #3098
2012-08-06 09:10:19 -07:00
Eric Holk
86947e47ad More documentation on pipes, and moving assert in runtime. 2012-08-06 09:07:40 -07:00
Ben Blum
4174de8bb9 rt: expose rust_task refcounts to rustland 2012-08-03 21:00:23 -04:00
Eric Holk
01ca0d1f68 Be more defensive in pipes (#3098) 2012-08-03 12:04:18 -07:00
Eric Holk
ce6d6511c7 Set thread name on Mac to make gdb thread info more useful. 2012-08-02 19:26:33 -07:00
Ben Blum
7cb3f3e86a Linked failure: enable unidirectional propagate test; replace FIXMEs with comments (tag #1868). 2012-08-01 23:08:06 -04:00
Lindsey Kuper
439afaa329 Change remaining "iface" occurrences to "trait"; deprecate "iface" 2012-07-31 11:52:16 -07:00
Ben Blum
60d682b577 Fix asserts & short-read bug in isaac_seed (#2870) 2012-07-25 18:03:00 -04:00
Ben Blum
729c37f3cc (minor) remove config_notify from rustrt.def.in 2012-07-25 13:29:50 -04:00
Ben Blum
8d43724087 minor rt cleanup 2012-07-25 13:24:00 -04:00
Ben Blum
c68f2d9aab Remove notification channels in runtime (closes #1078) 2012-07-25 13:22:43 -04:00
Ben Blum
695ab09899 Change yield() and wait_event() to be MUST_CHECK and return the killed flag. (closes #2875) 2012-07-24 18:24:24 -04:00
Ben Blum
2040a5c632 tiny runtime cleanup 2012-07-24 17:35:08 -04:00
Ben Blum
f42a5a1acd Remove unsupervise 2012-07-24 17:31:43 -04:00
Ben Blum
ae094a7adc Add 'do atomically { .. }' for exclusives 2012-07-24 15:28:35 -04:00
Elliott Slaughter
66e5a8ca18 Add rustrt wrapper functions to export list. 2012-07-23 12:21:41 -07:00
Elliott Slaughter
d257382863 Moved malloc and free upcalls into rust runtime. 2012-07-23 10:45:58 -07:00