Commit Graph

1572 Commits

Author SHA1 Message Date
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
Elliott Slaughter
de82a9be61 Move fail upcall into rust libcore. 2012-07-23 10:45:58 -07:00
Ben Blum
3dc52da989 [4/4 for #2365, #2671] Reassign one last fixme to #908. Close #2365. Close #2671. 2012-07-20 19:23:19 -04:00
Ben Blum
af7b769465 [3/4 for #2365, #2671] Fix exit/kill race with scheds during rust_kernel::fail 2012-07-20 19:23:19 -04:00
Ben Blum
18c645a883 [2/4 for #2365, #2671] Fix exit/kill race with tasks during rust_kernel::fail 2012-07-20 19:23:19 -04:00
Ben Blum
5bb4a12900 [1/4 for #2365, #2671] Fix create/kill race with schedulers and tasks during rust_kernel::fail 2012-07-20 19:23:19 -04:00
Ben Blum
4cf6b4d3b4 Tasks should not hold a ref to their parent (Close #1789) 2012-07-17 20:45:07 -04:00
Michael Sullivan
aa5b5ab886 Create some infrastructure for building up @-vectors. Work on #2921. 2012-07-17 17:09:25 -07:00
Ben Blum
1f2ee4b384 Oops, switch more TODOs to FIXMEs 2012-07-13 20:33:08 -04:00
Ben Blum
cd38377b1b Add asserts to check fail_sched_loop() only once 2012-07-13 20:13:53 -04:00
Ben Blum
d338879ba5 Reintroduce linked failure (killing runtime)
This reverts commit 5724c64549.
2012-07-13 20:13:53 -04:00
Ben Blum
62575d9c4a Reintroduce linked failure (rust_port locking)
This reverts commit a10f52c579.
2012-07-13 20:13:53 -04:00
Ben Blum
aad184cc57 Reintroduce linked failure (renaming runtime fns)
This reverts commit 3b159c6d5b.
2012-07-13 20:13:53 -04:00
Ben Blum
79a2e9a38a Reintroduce linked failure (lifecycle lock)
This reverts commit 08c40c5eb7.
2012-07-13 20:13:53 -04:00
Ben Blum
df2d2604ca Reintroduce linked failure
This reverts commit acb86921a6.
2012-07-13 20:13:53 -04:00
Tim Chevalier
81ecd272d3 Comments only: TODOs to FIXME in the runtime 2012-07-12 19:06:08 -07:00
Graydon Hoare
18da7fef88 Merge remote-tracking branch 'origin/dist-snap' into incoming 2012-07-12 17:14:55 -07:00
Ben Blum
acb86921a6 Revert linked failure
This reverts commit 5d6d3d0565.
2012-07-12 19:49:49 -04:00
Ben Blum
08c40c5eb7 Revert linked failure (lifecycle lock)
This reverts commit 74f4b8d901.
2012-07-12 19:49:49 -04:00
Ben Blum
3b159c6d5b Revert linked failure (renaming runtime fns)
Revert "Rename runtime *_locked() and *_unlocked() fns to *_inner() (closes #2864)"

This reverts commit b897696a3a.
2012-07-12 19:49:49 -04:00
Ben Blum
a10f52c579 Revert linked failure (rust_port locking)
This reverts commit 343e9de8ef.
2012-07-12 19:49:49 -04:00
Ben Blum
5724c64549 Revert linked failure (killing runtime)
This reverts commit 200a2ded32.
2012-07-12 19:49:49 -04:00
Ben Blum
200a2ded32 Fix linked failure with root taskgroup to kill the runtime too. 2012-07-12 18:08:36 -04:00
Ben Blum
343e9de8ef Proper locking with blocked_on()/wakeup() in rust_port. Closes #2787. Closes #1923. 2012-07-12 18:08:36 -04:00
Ben Blum
b897696a3a Rename runtime *_locked() and *_unlocked() fns to *_inner() (closes #2864) 2012-07-12 18:08:36 -04:00
Michael Sullivan
9d2e5f3a65 Merge branch 'rt-changes' into incoming 2012-07-12 15:03:54 -07:00
Erick Tryzelaar
91d9ded4be Fix an error for Centos 5
Unfortunately this doesn't get rust to compile on Centos 5.
Centos 5 uses glibc 2.5, but the snapshot-0 needs glibc 2.6+.
2012-07-11 20:09:57 -07:00
Michael Sullivan
62e9ae04e2 Remove obsolete type param field from shape information. 2012-07-11 11:42:49 -07:00
Ben Blum
74f4b8d901 Unify state_lock + kill_lock -> lifecycle_lock (#2787) 2012-07-11 12:09:07 -04:00
Ben Blum
5d6d3d0565 Linked failure in task.rs instead of rust_task.cpp (#1868, #1189) 2012-07-11 12:07:06 -04:00
Ben Blum
9c0b469613 Add rust_task_kill_other 2012-07-11 12:07:06 -04:00
Ben Blum
e8b13e8f26 rust_task.h - fix disallow_kill & don't inherit rust_cond 2012-07-11 12:07:06 -04:00
Eric Holk
26e6eb3d14 Handle failure conditions correctly in pipes. 2012-07-10 22:00:47 -07:00
Michael Sullivan
a7897b3ef3 Eliminate some obsolete upcalls. 2012-07-10 16:33:21 -07:00
Michael Sullivan
260f73ed85 Get rid of unused fields in tydescs. Closes #2351. 2012-07-10 16:33:21 -07:00
Eric Holk
e5c9cb2b3d Pipes sleep and wake properly. 2012-07-06 10:42:39 -07:00
Ben Blum
7b3add0632 make disallow_kill an int for nested unkillables (closes #2782) 2012-07-05 19:56:09 -04:00
Jeff Olson
a3c933e0a0 std: uv::ll fixes for 32bit linux 2012-06-29 15:41:56 -07:00
Jeff Olson
cfcd3e683b std/rt: cleanup and adding sockaddr_in6 mapping for win32 2012-06-29 15:41:56 -07:00
Jeff Olson
9edcb104ff std: addressing #2656 (ipv6 support in net::tcp)
.. there are some additional FIXME nags in net_tcp (L 1012) about blocking
because libuv is holding unsafe ptrs to task local data. the proposed
fix going is not really feasible w/ the current design, IMO, but i'll
leave it there in case someone really wants to make the case without
creating more hassle than it's worth.
2012-06-29 15:41:56 -07:00
Jeff Olson
8794815da9 rt: get rid of unused helpers for AF_INET and add bool-based ones, instead 2012-06-29 15:41:56 -07:00
Jeff Olson
61cc8a07f8 rt: whitespace cleanup in rust_uv 2012-06-29 15:41:56 -07:00
Jeff Olson
bcc341f5fb rt: adding uv_freeaddrinfo binding and tweek signature for uv_getaddrinfo 2012-06-29 15:41:56 -07:00
Jeff Olson
cac2a04667 fix typo in rustrt.def.in 2012-06-29 15:41:56 -07:00
Jeff Olson
237589b3c0 rt: more helper functions to get uv_getaddrinfo going 2012-06-29 15:41:56 -07:00
Jeff Olson
2ef9548f2c rt: more sizeof helpers + misc consts for uv_getaddrinfo 2012-06-29 15:41:55 -07:00
Jeff Olson
511873afe3 rt: add remaining ip string parser/formatter helpers from uv 2012-06-29 15:41:55 -07:00
Ben Blum
6fc730baf6 Cleanup failure handling around rust_new_task_in_sched - closes #2668 2012-06-28 19:02:48 -04:00
Ben Blum
ae7b0ac390 move reset_stack_limit off C stack (closes #2679) 2012-06-28 14:53:21 -04:00
Ben Blum
af2d01e36b Fix sys::refcount and remove dbg::refcount 2012-06-28 14:40:31 -04:00
Tim Chevalier
ad8280712f Remove FIXME question
brson said the answer to the question is probably no... so I'm
going to be bold and remove this.

Closes #2685
2012-06-28 10:53:37 -07:00
Tim Chevalier
c79b76d499 Remove obsolete FIXME
brson said it's obsolete and I trust him.

Closes #2695
2012-06-28 10:51:14 -07:00
Brian Anderson
6f57c61ed0 Tidy fixes 2012-06-27 22:03:12 -07:00
Ben Blum
1ba3028d8b rt: Add task_local_data and related builtin calls (Closes #2680) 2012-06-28 00:10:03 -04:00
Graydon Hoare
576f59a79b Change 'upcall fail' to 'task failed at', close #2678. 2012-06-27 13:30:49 -07:00
Graydon Hoare
d3c6119a7a More keyword paring and migration in runtime, docs, code modes. 2012-06-27 13:30:49 -07:00
Tim Chevalier
6141f5ce5a Fix shape::cmp::walk_res2 2012-06-26 11:14:39 -07:00
Brian Anderson
7adad4c6cb rt: Fix exports 2012-06-25 16:30:42 -07:00
Brian Anderson
d29e8fc059 rt: Remove upcall_malloc/upcall_exchange_malloc. Issue #2681 2012-06-25 16:01:47 -07:00
Brian Anderson
3d0826b5fc rt: Remove lock_free_queue. Unused. Issue #2701 2012-06-25 15:39:59 -07:00
Tim Chevalier
da470ff5b8 Merge 2012-06-25 13:29:41 -07:00
Tim Chevalier
25b8b35c57 Finish compare glue for classes
This tests == and !=. I don't know what <, >, etc. should do.
Closes #2601
2012-06-25 12:20:10 -07:00
Tim Chevalier
487cbf8e90 Remove resources
Also fixed shapes for classes with dtors, as well as handling
offsets for classes with dtors correctly in take glue.

Closes #2485
2012-06-24 15:09:57 -07:00
Eric Holk
26c11f7b50 Use must_have_lock instead of private functions. (Issue #2700)
I hereby declare that messages sent from the same source arrive in order (Issue #2605)

Removing FIXME, owned is the correct type here. (Issue #2704)

Remove outdated FIXME (Issue #2703)

Updating test for spawning native functions (Issue #2602)

Removing bogus FIXME (Issue #2599)
2012-06-22 15:14:42 -07:00
Graydon Hoare
312faf31df Tag all remaining FIXMEs with bugs. Install rule in tidy script to enforce this. 2012-06-21 16:44:10 -07:00
Tim Chevalier
f149ea0c68 Remove unneeded field 2012-06-21 16:03:28 -07:00
Tim Chevalier
dc11396fda Remove unneeded SHAPE_VEC const 2012-06-21 16:03:28 -07:00
Tim Chevalier
c814df0bd6 Comments only: annotate FIXMEs 2012-06-21 16:03:28 -07:00
Tim Chevalier
be8b09160b Try removing code marked with "I don't think this is necessary" 2012-06-21 16:03:28 -07:00
Michael Sullivan
393f739990 Rename upcall_malloc_dyn to just upcall_malloc. 2012-06-21 10:47:45 -07:00
Eric Holk
ec0fbf526e Fixed a compile error in runtime. 2012-06-19 12:26:58 -07:00
Eric Holk
dc718d97a6 Adding a lock/condition variable to libcore. 2012-06-19 10:31:12 -07:00
Ben Blum
ee9e5b9d20 Avoid extra get_current_task()s in many upcalls (performance) 2012-06-18 20:36:25 -04:00
Michael Sullivan
30dd32d4db Fix generation of str/@. Closes #2638. 2012-06-18 15:54:37 -07:00
Michael Sullivan
797856cbde Use unboxed vecs for string shape glue. 2012-06-18 15:54:37 -07:00
Michael Sullivan
88ec259cee Put type descriptors in strings created by the runtime. Progress on #2638. 2012-06-18 15:54:37 -07:00
Michael Sullivan
b4484d51c1 Some cleanup in the runtime. 2012-06-18 15:54:37 -07:00
Tim Chevalier
3e2006a570 Revert "Adding a lock/condition variable to libcore."
This reverts commit e394ebda37.
2012-06-16 15:34:15 -07:00
Eric Holk
e394ebda37 Adding a lock/condition variable to libcore. 2012-06-15 22:00:24 -04:00
Michael Sullivan
2b70cbc992 Remove some dead code from rust_shape 2012-06-15 17:42:48 -07:00
Michael Sullivan
999ab5418a Make the shape interpreter actually advance past fixed length vectors. Closes #2613. 2012-06-15 15:31:19 -07:00
Michael Sullivan
a72d469067 Add upcall_malloc_dyn to rustrt.def.in. 2012-06-13 18:36:58 -07:00
Michael Sullivan
591b2802ff Make trans only generate calls to the _dyn malloc upcalls, so we can get rid of the non dyn ones. 2012-06-13 18:00:17 -07:00
Michael Sullivan
4c0d41cffa Add a malloc_dyn upcall for dynamically sized allocations on the shared heap. 2012-06-13 17:59:21 -07:00
Michael Sullivan
e67b5b25a6 Introduce a SHAPE_UNBOXED_VEC shape in order to seperate out vector logic. 2012-06-12 17:01:13 -07:00
Michael Sullivan
665ba3531d Clean up tydesc declaration to make it clear what is unused. 2012-06-11 12:29:04 -07:00
Michael Sullivan
b22620624c Get rid of a bunch of dead shape code. Closes #2552. 2012-06-11 12:19:40 -07:00
Michael Sullivan
70b79d1e32 Add emacs settings to some runtime files where they were missing. 2012-06-11 12:19:40 -07:00
Michael Sullivan
45cc95fa22 Remove a bunch of old "remove after snapshot" code. 2012-06-07 18:05:12 -07:00
Brian Anderson
89483b0b83 rt: Remove check_stack_alignment
This function does not do what it tries to do and it is expensive
2012-06-07 11:12:29 -07:00
Brian Anderson
c816eea000 std: Add debug::breakpoint 2012-06-06 23:39:55 -07:00
Brian Anderson
99d6807ee0 rt: Unique allocations have -1 ref count 2012-06-05 00:21:27 -07:00
Brian Anderson
78fe75a741 rt: Fix iaac_init using wrong type and not seeding correctly
This was a result of changing the vector representation to contain
a box header.
2012-06-05 00:21:19 -07:00
Brian Anderson
e04e9488ad Revert "rt: Unique allocations have -1 ref count"
This reverts commit 422aec85d6.
2012-06-04 22:58:15 -07:00
Brian Anderson
422aec85d6 rt: Unique allocations have -1 ref count 2012-06-04 22:45:46 -07:00
Arkaitz Jimenez
dad3007584 Moved log method into logger class better than scheduler fixes #2495 2012-06-04 01:53:24 +01:00
Brian Anderson
35aa8d86e1 rt: Add a FIXME about #2495 2012-06-03 14:47:04 -07:00
Arkaitz Jimenez
9a2b240c89 Show ellipsis sign when log line is truncated 2012-06-03 21:06:42 +01:00
Brian Anderson
94ac30c498 rt: Improve docs for main, kernel, scheduler, and task 2012-06-02 23:14:47 -07:00
Brian Anderson
4c8bc19ad2 rt: Refactor task failure to go through rust_task_fail
This is the place to but a breakpoint. We will raise SIGINT here
to break into the debugger.
2012-05-31 23:47:52 -07:00
Brian Anderson
b16bdd9ed0 rt: Don't zero the unique box header 2012-05-30 21:23:34 -07:00
Brian Anderson
a2bbdd3f52 rt: Remove upcall_shared_malloc/free/realloc 2012-05-30 21:23:34 -07:00
Brian Anderson
70ecfa686a rt: Fix build errors on win 2012-05-30 21:23:34 -07:00
Brian Anderson
3f8223ffc2 rt: Fix vec_from_buf_shared for new vecs 2012-05-30 21:23:34 -07:00
Brian Anderson
ecd4318094 rt: Fix rust_list_files for new vecs 2012-05-30 21:23:34 -07:00
Brian Anderson
09a1b94907 Various changes for self-describing vecs 2012-05-30 21:23:34 -07:00
Brian Anderson
178c5cc4a3 rt: Add yet another allocating upcall
upcall_exchange_malloc_dyn, for allocating unique boxes for types that don't
have a fixed size.
2012-05-30 21:23:34 -07:00
Brian Anderson
654f7e3086 rustc: Make unique boxes self-describing 2012-05-30 21:23:34 -07:00
Brian Anderson
508ccca014 rt: Add upcall_exchange_malloc/free 2012-05-30 21:23:33 -07:00
Eric Holk
6fa1a084f7 A shareable atomically reference counted pointer wrapper.
Needs more tests to ensure safety, and probably some more work on usability too.
2012-05-23 14:58:16 -07:00
Jeff Olson
6c6a47bf22 std: splitting out tcp server API + tests
- we now have two interfaces for the TCP/IP server/listener workflow,
based on different user approaches surrounding how to deal with the
flow of accept a new tcp connection:

1. the "original" API closely mimics the low-level libuv API, in that we
have an on_connect_cb that the user provides *that is ran on the libuv
thread*. In this callback, the user can accept() a connection, turning it
into a tcp_socket.. of course, before accepting, they have the option
of passing it to a new task, provided they *make the cb block until
the accept is done* .. this is because, in libuv, you have to do the
uv_accept call in the span of that on_connect_cb callback that gets fired
when a new connection comes in. thems the breaks..

I wanted to just get rid of this API, because the general proposition of
users always running code on the libuv thread sounds like an invitation
for many future headaches. the API restriction to have to choose to
immediately accept a connection (and allow the user to block libuv as
needed) isn't too bad for power users who could conceive of circumstances
where they would drop an incoming TCP connection and know what they're
doing, in general.

but as a general API, I thought this was a bit cumbersome, so I ended up
devising..

2. an API that is initiated with a call to `net::tcp::new_listener()` ..
has a similar signature to `net::tcp::listen()`, except that is just
returns an object that sort of behaves like a `comm::port`. Users can
block on the `tcp_conn_port` to receive new connections, either in the
current task or in a new task, depending on which API route they take
(`net::tcp::conn_recv` or `net::tcp::conn_recv_spawn` respectively).. there
is also a `net::tcp::conn_peek` function that will do a peek on the
underlying port to see if there are pending connections.

The main difference, with this API, is that the low-level libuv glue is
going to *accept every connection attempt*, along with the overhead that
that brings. But, this is a much more hassle-free API for 95% of use
cases and will probably be the one that most users will want to reach for.
2012-05-22 22:29:17 -07:00
Jeff Olson
e9c6416df6 std: splitting out tcp server API WIP 2012-05-22 22:29:17 -07:00
Jeff Olson
8769409612 rt: adding rust_uv_* binding for kernel malloc and free'ing :/
I need these in the context of doing various malloc/free operations for
libuv structs that need to live in the heap, because of API workflow
(there's no stack to put them in). This has cropped up several times
when impl'ing the high-level API for things like timers, but I've decided
to take the plunge and use this approach for the net::tcp module.

Technically, this can be avoided by spawning a new
task that contains the needed memory structures on its stack and then
having it block for the duration of the time we need that memory to be
valid (this is what I did in std::timer). Exposing this API provides a
much lower overhead way to address
the issue, albeit with safety concerns. The main mitigation policy should
be to use malloc/free with libuv handles only when the handles, are then
associated with a resource or class-with-dtor. So we have a finite lifetime
for the object and can gaurantee a free(), barring a runtime crash (in
which case you have bigger problems!)
2012-05-22 22:29:16 -07:00
Brian Anderson
17dd5650f8 rt: Fix def of isaac_seed on windows 2012-05-21 17:42:32 -07:00
Gareth Daniel Smith
c9f8ae02bc add a seeded random number generator so that sequences of random numbers can be easily reproduced (for https://github.com/mozilla/rust/issues/2379) 2012-05-21 17:38:05 -07:00
Erick Tryzelaar
e7ca3e4db0 expose tzset 2012-05-19 10:08:43 -07:00
Niko Matsakis
f1a46914c4 add a new debugging aid--tracing 2012-05-18 19:07:19 -07:00
Brian Anderson
5d625af9f9 rt: Make task killing synchronization possibly more correct
I could not come up with a test but this looks better to me.
2012-05-15 16:13:42 -07:00
Brian Anderson
7277cd7198 core: Add task::unkillable 2012-05-15 16:13:42 -07:00
Niko Matsakis
adb61e3e99 get preservation of boxes working, at least in simple cases 2012-05-15 13:38:16 -07:00
Niko Matsakis
be48cd87dc make poison-on-free work, disable copying if borrowck is enabled 2012-05-15 11:49:08 -07:00
Brian Anderson
f717100fc7 rt: Start tasks, ports and scheds at 1, assert when we see 0. Closes #2321 2012-05-07 14:32:36 -07:00
Brian Anderson
beb1a59f82 core: Add comm::recv_chan to receive from a channel 2012-05-03 16:38:16 -07:00
Graydon Hoare
6e5c8a7fb8 More shape fixes for evecs. 2012-05-03 14:11:54 -07:00
Graydon Hoare
11a5d10bf2 Implement better shape code for evec, estr. 2012-05-03 13:09:02 -07:00
Brian Anderson
1e410f6206 rt: Fix some record alignment issues on windows 2012-05-02 18:32:20 -07:00
Brian Anderson
e2910bf264 Revert "rt: Fix some record alignment issues on windows"
This reverts commit a2457f5864.
2012-05-02 18:25:22 -07:00
Brian Anderson
a2457f5864 rt: Fix some record alignment issues on windows 2012-05-02 17:55:58 -07:00
Graydon Hoare
f32d9f4853 Remove unused sp_size arg passed through walk_vec{1,2} in shape code. 2012-05-02 14:36:04 -07:00
Graydon Hoare
dc6c3a8946 Make rust_shape.h agree with shape.rs about meaning of shape code #31. 2012-05-02 14:36:04 -07:00
Brian Anderson
46cc11ea88 core: Serialize all access to the environment using a weak global task 2012-04-30 17:34:29 -07:00
Jeff Olson
caab57586a rt/std: whitespace cleanup + work on hl/global_loop docs 2012-04-27 22:19:30 -07:00
Jeff Olson
577b888e4b rt: remove unneccesary c++ functions and rust_kernel data, re: global loop 2012-04-27 22:19:30 -07:00
Jeff Olson
fbaba0f404 std: add ll::loop_refcount binding for uv_loop_refcount 2012-04-27 22:19:30 -07:00
Brian Anderson
bbc4a74dc6 rt: Fix shape alignment of 64-bit ints on x86. Issue #2303 2012-04-26 18:30:58 -07:00
Jeff Olson
a9db0c9efe whitespace cleanup 2012-04-20 15:23:23 -07:00
Jeff Olson
a045e63639 std: get_monitor_task_gl() is global_loop::get() default 2012-04-20 15:23:23 -07:00
Jeff Olson
bea02ee351 adding missing binding to rustrt.def.in 2012-04-20 15:23:22 -07:00
Jeff Olson
253fad7788 replace impl of globa_async_handle with one using atomic compare-and-swap 2012-04-20 15:23:22 -07:00
Jeff Olson
d7a87aa0a1 remove rustrt.def.in entry for no-longer-existent c++ function 2012-04-20 15:23:22 -07:00
Jeff Olson
9a5d1974dc don't use ::malloc for initializing the global_async_handle in rust_kernel 2012-04-20 15:23:22 -07:00
Jeff Olson
e0f110aa12 clean and trying the global loop test as two separate loop lifetimes..
.. seeing an occasional valgrind/barf spew on some invalid read/writes..
need to investigate further.. i think its related to my poor citizen
conduct, re: pointers stashed in rust_kernel..
2012-04-20 15:23:22 -07:00
Jeff Olson
12f2f4c15c rt: whitespace cleanup for existing libuv integration 2012-04-20 15:23:22 -07:00
Jeff Olson
e604c15df1 bindings to get/set data field on uv_loop_t* and debug log cleanup 2012-04-20 15:23:21 -07:00
Jeff Olson
c6667c06c3 add needed fields for global libuv loop + bindings to manage from rust
adding two pointers fields to rust_kernel :(
.. have to do manual malloc/free for one of the fields, which feels wrong
2012-04-20 15:23:21 -07:00
Jeff Olson
bf99a3aa93 adding low-level uv_timer_* stuff to libuv bindings 2012-04-20 15:23:21 -07:00
Jeff Olson
3d004c6df8 making brson's req. cleanups in #2134 plus change printf to LOG in c++ 2012-04-20 15:23:21 -07:00
Brian Anderson
53f5c0c623 rt: Delete some incorrect comments 2012-04-20 14:00:13 -07:00
Brian Anderson
4357e1fd60 rt: Take the weak_task_lock in end_weak_tasks
Don't remember why it's commented out. Probably an oversight.
2012-04-20 13:59:31 -07:00
Niko Matsakis
171c89f4c5 Fix for #1989, #1469: when marking in CC, walk fn@ box like other boxes 2012-04-19 20:34:26 -07:00
Niko Matsakis
21f74be2c1 add a new runtime log (::rt::box) and make boxed_region use it 2012-04-19 20:34:26 -07:00
Brian Anderson
9604544e23 rt: Don't log in the stack switching failure path
The runtime is in an uncertain state here and, instead of thinking
about how to make the logger work correctly, let's just avoid it.

Currently, it ends up hitting an assert saying that we can't log on
the rust stack.
2012-04-18 18:45:24 -07:00
Graydon Hoare
82727b926f Get explicit unique estrs working. 2012-04-16 16:17:51 -07:00
Brian Anderson
564d8e09c7 rt: Fix typo 2012-04-09 16:26:23 -07:00
Brian Anderson
596376ea55 rt: Allow 2x normal stack during unwinding. Closes #2173
Allows room for destructors to run without allowing the stack to grow forever.
2012-04-09 16:03:06 -07:00
Brian Anderson
b42c6d07dc rt: Don't limit the amount of stack available during unwinding. Closes #2144 2012-04-09 15:36:45 -07:00
Brian Anderson
01dc4a8b26 core: Add priv::weaken_task 2012-04-07 19:56:41 -07:00
Brian Anderson
63942c969d core: Add priv::chan_from_global_ptr
This allows singleton, globally accessible tasks to be created
2012-04-06 17:44:26 -07:00
Jeff Olson
82f8d8cb2a removing some unneeded native fn mappingsin uv.rs and misc clean
.. 32bit linux issues persist.
2012-04-06 15:35:50 -07:00
Jeff Olson
6b349f3d11 experimenting with a different uv_buf_init impl to placate 32bit linux 2012-04-06 15:35:50 -07:00