Commit Graph

1858 Commits

Author SHA1 Message Date
Brian Anderson
cb9ee7f5be std: Remove ManualThreads spawn mode 2013-07-30 14:23:45 -07:00
Brian Anderson
0144c83213 std::rt: Change Thread interface to require an explicit join
Makes it more obvious what's going on
2013-07-30 14:23:44 -07:00
bors
6dc5e2c61f auto merge of #8046 : kmcallister/rust/unused-log, r=pcwalton 2013-07-28 12:52:25 -07:00
bors
15310ba7c2 auto merge of #8040 : luqmana/rust/rtn, r=brson
Implements various missing tcp & udp methods.. Also fixes handling ipv4-mapped/compatible ipv6 addresses and addresses the XXX on `status_to_maybe_uv_error`.

r? @brson
2013-07-27 01:49:35 -07:00
Luqman Aden
037bf3757c libstd: Implement some missing udp methods. 2013-07-25 22:21:46 -04:00
Keegan McAllister
d0f54a5cfb Warn about unused RUST_LOG specs 2013-07-25 13:24:32 -07:00
Luqman Aden
61e741cf71 libstd: Implement {peer, socket}_name for new rt tcp & udp. 2013-07-25 05:57:52 -04:00
Daniel Micay
ce1db94647 rm unused upcall_exchange_free 2013-07-24 18:44:16 -04:00
bors
7f96eb58d2 auto merge of #7980 : graydon/rust/misc-benchmarks, r=catamorphism
Some machinery for enabling #[bench] benchmarks in std and some examples showing how to write them.
2013-07-23 22:46:39 -07:00
Graydon Hoare
bc2b78ca2c rt: Fix child-iteration bug in crate map. 2013-07-22 16:56:10 -07:00
Brian Anderson
407bffb33e std: Remove at_exit API. Unused 2013-07-22 14:17:09 -07:00
Brian Anderson
23b7ee2bda std: Remove unstable::global. Unused 2013-07-22 14:16:52 -07:00
Brian Anderson
4beda4e582 std::rt: Stop using unstable::global in change_dir_locked 2013-07-22 14:16:52 -07:00
Brian Anderson
f8c4d99df6 std: Remove weak_task API. Unused 2013-07-22 14:16:52 -07:00
Daniel Micay
ed67cdb73c new snapshot 2013-07-22 01:09:48 -04:00
bors
91ebfbb959 auto merge of #7859 : kmcallister/rust/rt-diag-messages, r=pcwalton
I added these while tracking down heap corruption in Servo.
2013-07-18 22:40:38 -07:00
bors
b70c045f38 auto merge of #7856 : brson/rust/no-thread-per-core, r=pcwalton
This doesn't make sense under the new scheduler.
2013-07-18 19:10:41 -07:00
Keegan McAllister
2d82d9364c rt: Print alloc backtraces for bad release_alloc with RUSTRT_TRACK_ALLOCATIONS
Probably the env var should be renamed from DETAILED_LEAKS but I'm leaving
aside that breaking change for now.
2013-07-17 14:04:03 -07:00
Keegan McAllister
dfa5595628 rt: Diagnose bad alloc index in release_alloc with RUSTRT_TRACK_ALLOCATIONS 2013-07-17 14:03:59 -07:00
Daniel Micay
e118555ce6 remove headers from unique vectors 2013-07-15 23:57:27 -04:00
bors
d582eeb1ec auto merge of #7734 : alexcrichton/rust/issue-3395, r=sanxiyn
Also ends up fixing one case in libstd. 

Closes #3395
2013-07-12 21:40:36 -07:00
bors
4e1292ad6b auto merge of #7728 : bcully/rust/largestack64, r=cmr
Just to get the ball rolling, this patch sets stacks to 4 MB on >32-bit architectures.
2013-07-12 09:40:36 -07:00
bors
07183ea6e7 auto merge of #7677 : alexcrichton/rust/tls-gc, r=pcwalton
cc #6004 and #3273

This is a rewrite of TLS to get towards not requiring `@` when using task local storage. Most of the rewrite is straightforward, although there are two caveats:

1. Changing `local_set` to not require `@` is blocked on #7673
2. The code in `local_pop` is some of the most unsafe code I've written. A second set of eyes should definitely scrutinize it...

The public-facing interface currently hasn't changed, although it will have to change because `local_data::get` cannot return `Option<T>`, nor can it return `Option<&T>` (the lifetime isn't known). This will have to be changed to be given a closure which yield `&T` (or as an Option). I didn't do this part of the api rewrite in this pull request as I figured that it could wait until when `@` is fully removed.

This also doesn't deal with the issue of using something other than functions as keys, but I'm looking into using static slices (as mentioned in the issues).
2013-07-11 19:52:37 -07:00
Alex Crichton
2cd9d7bc88 Expand ctypes warnings to warn about *int/*uint
Also ends up fixing one case in libstd
2013-07-11 19:45:25 -07:00
Brendan Cully
7910c72de5 Enable large stacks on 64-bit architectures 2013-07-11 15:40:16 -07:00
bors
41dcec2fe1 auto merge of #7265 : brson/rust/io-upstream, r=brson
r? @graydon, @nikomatsakis, @pcwalton, or @catamorphism

Sorry this is so huge, but it's been accumulating for about a month. There's lots of stuff here, mostly oriented toward enabling multithreaded scheduling and improving compatibility between the old and new runtimes. Adds task pinning so that we can create the 'platform thread' in servo.

[Here](e1555f9b56/src/libstd/rt/mod.rs (L201)) is the current runtime setup code.

About half of this has already been reviewed.
2013-07-09 18:28:46 -07:00
Brian Anderson
1dbcc8b188 std: Remove ThreadPerCore spawn mode. Unused 2013-07-09 17:45:06 -07:00
Alex Crichton
a89af1fa4c Use purely an owned vector for storing TLS data 2013-07-09 17:31:01 -07:00
Brian Anderson
2c1315719d rt: Make the old rand builtins work with newsched 2013-07-09 15:05:43 -07:00
Brian Anderson
07e52eb7fc std: Make os::set_exit_status work with newsched 2013-07-09 13:29:05 -07:00
Brian Anderson
fae3336769 Merge remote-tracking branch 'mozilla/master'
Conflicts:
	src/libextra/test.rs
	src/libstd/rt/global_heap.rs
	src/libstd/unstable/lang.rs
	src/libstd/vec.rs
2013-07-08 16:29:54 -07:00
Brian Anderson
b227583dad Merge remote-tracking branch 'anasazi/io'
Conflicts:
	src/libstd/rt/test.rs
2013-07-08 15:53:11 -07:00
Brian Anderson
4282539523 std::rt: Add a hack to allocate different test port ranges to different bots 2013-07-08 14:41:07 -07:00
Eric Reed
cf23292010 Merge remote-tracking branch 'upstream/io' into io
Conflicts:
	src/libstd/rt/uvio.rs
2013-07-08 13:03:18 -07:00
Niko Matsakis
59083d2c6a Address nits by @catamorphism 2013-07-08 13:55:10 -04:00
Niko Matsakis
af453a33cc This assert does not necessarily hold; sometimes we temporarily increase ref-count 2013-07-08 13:55:10 -04:00
Luqman Aden
5007fb2d4d Add x64 windows to platform.mk and mingw64 header fixes. 2013-07-03 23:33:59 -04:00
Brian Anderson
1098d6980b Merge remote-tracking branch 'mozilla/master'
Conflicts:
	src/libextra/test.rs
	src/libstd/at_vec.rs
	src/libstd/cleanup.rs
	src/libstd/rt/comm.rs
	src/libstd/rt/global_heap.rs
	src/libstd/task/spawn.rs
	src/libstd/unstable/lang.rs
	src/libstd/vec.rs
	src/rt/rustrt.def.in
	src/test/run-pass/extern-pub.rs
2013-07-03 14:49:13 -07:00
Eric Reed
6a1a7819c9 Merge remote-tracking branch 'upstream/io' into io
Conflicts:
	src/libstd/rt/test.rs
	src/rt/rustrt.def.in
2013-07-02 16:55:56 -07:00
Eric Reed
e6c57793be IPv6 support for UDP and TCP. 2013-07-02 16:40:57 -07:00
Brian Anderson
0e07c8d249 rt: Add global_args_lock functions to rustrt.def.in 2013-07-01 16:38:17 -07:00
Daniel Micay
b731d96b4f vec: implement exchange vector reserve in Rust 2013-06-30 22:30:37 -04:00
Daniel Micay
b883d6a54c simplify the exchange allocator
* stop using an atomic counter, this has a significant cost and
  valgrind will already catch these leaks
* remove the extra layer of function calls
* remove the assert of non-null in free, freeing null is well defined
  but throwing a failure from free will not be
* stop initializing the `prev`/`next` pointers
* abort on out-of-memory, failing won't necessarily work
2013-06-30 03:45:36 -04:00
bors
0bad3e62b4 auto merge of #7395 : yichoi/rust/android_dummy, r=brson
add android dummy functions which does not exist in boinic.

after #7257, some mman related functions are needed for android.
2013-06-27 03:07:31 -07:00
Brian Anderson
8918461fc4 rt: Release big stacks immediately after use to avoid holding on to them through yields
This avoids the following pathological scenario that makes threadring OOM:

1) task calls C using fast_ffi, borrowing a big stack from the scheduler.
2) task returns from C and places the big stack on the task-local stack segment list
3) task calls further Rust functions that require growing the stack, and for this reuses the big stack
4) task yields, failing to return the big stack to the scheduler.
5) repeat 500+ times and OOM

Conflicts:
	src/rt/rust_task.cpp
2013-06-26 15:18:36 -07:00
Young-il Choi
6a77273104 rt: add android dummy functions for mman related 2013-06-26 10:25:12 +09:00
Eric Reed
f202713b73 satisfy the formatting check 2013-06-25 14:40:36 -07:00
Eric Reed
4870dce3eb Merge remote-tracking branch 'upstream/io' into io
Conflicts:
	src/rt/rustrt.def.in
2013-06-25 11:45:44 -07:00
bors
7aee5da08d auto merge of #7254 : Blei/rust/intrinsic-overhaul, r=cmr
This sets the `get_tydesc()` return type correctly and removes the intrinsic module. See #3730, #3475.

Update: this now also removes the unused shape fields in tydescs.
2013-06-25 04:38:06 -07:00
Brian Anderson
5e7c5d6c3d std: Make box annihilator work with newsched 2013-06-24 17:07:03 -07:00
Brian Anderson
aa9210d25a std: Rewrite vec_reserve_shared_actual in Rust 2013-06-24 17:07:01 -07:00
Alex Crichton
8fdc8f392c Support foreign 'static mut' variables as well 2013-06-23 18:00:32 -07:00
Philipp Brüschweiler
e2f1049bd5 Remove unused TyDesc parameter from the glue functions
To remove the environment pointer, support for function pointers without
an environment argument is needed (i.e. a fixed version of #6661).
2013-06-23 13:02:00 +02:00
Philipp Brüschweiler
976c0b3dfb Remove rust_call_tydesc_glue
Towards #4812. Also includes some minor cleanups.
2013-06-23 12:49:16 +02:00
Philipp Brüschweiler
8bf0033345 Remove unused shape fields from typedescs 2013-06-23 12:49:16 +02:00
Brian Anderson
95eb01957b std: Make console log off/on controls work with newsched 2013-06-21 16:52:07 -07:00
Brian Anderson
1b7c99655f std::rt: Support os::args 2013-06-21 14:42:15 -07:00
bors
45f588e8fd auto merge of #7200 : yichoi/rust/fix_je_mac_cross, r=brson
while cross-compiling, ar in cross toolchains are required. 
linux is not sensitive so could not see errors.
2013-06-21 04:10:53 -07:00
Brian Anderson
357f087786 Merge remote-tracking branch 'brson/io' into io-upstream
Conflicts:
	src/rt/rust_builtin.cpp
	src/rt/rustrt.def.in
2013-06-20 12:17:00 -07:00
James Miller
3bc4d1a120 Remove all #[cfg(stage0)]-protected code
New snapshot means this can all go. Also removes places that have
comments that say they are workarounds for stage0 errors.
2013-06-21 02:43:02 +12:00
Brian Anderson
5086c0850e std::rt: Update GC metadata in init 2013-06-19 16:08:07 -07:00
Brian Anderson
7f55fc33f0 std: Work around some failing 'run' tests when valgrinding. #7224
Under valgrind on 64->32 cross compiles the dynamic linker is emitting
some error messages on stderr, which interferes with the tests that
are checking stderr.
2013-06-18 19:52:05 -07:00
Eric Reed
35f3fa6383 Merge remote-tracking branch 'upstream/io' into io
Conflicts:
	src/libstd/rt/uvio.rs
2013-06-17 12:45:40 -07:00
Young-il Choi
474bd60c1b rt: fix jemalloc android cross-compile for mac 2013-06-17 20:20:24 +09:00
Brian Anderson
319cf6e465 Merge remote-tracking branch 'brson/io'
Conflicts:
	src/libstd/rt/comm.rs
	src/libstd/rt/mod.rs
	src/libstd/rt/sched.rs
	src/libstd/rt/task.rs
	src/libstd/rt/test.rs
	src/libstd/rt/tube.rs
	src/libstd/rt/uv/uvio.rs
	src/libstd/rt/uvio.rs
	src/libstd/task/spawn.rs
2013-06-16 15:09:25 -07:00
Niko Matsakis
461a79a247 Partial fix for #7158: Save EDX in morestack on x86-32 2013-06-16 12:46:51 -04:00
Eric Reed
74e7255193 Added a utility function to extract the udp handle from udp send requests. 2013-06-14 11:39:46 -07:00
Daniel Micay
ec27644870 automated whitespace fixes 2013-06-13 18:03:08 -04:00
Eric Reed
5393e43b53 Corrected libuv UDP bindings. 2013-06-13 12:51:32 -07:00
Daniel Micay
0685c657f0 update jemalloc to 3.4.0 2013-06-12 00:26:15 -04:00
bors
1175e94de3 auto merge of #7033 : influenza/rust/rust-7022, r=graydon
This commit fixes #7022 - I've added an additional check to ensure that
stk is not null before dereferencing it to get it's next element,
assigning NULL if it is itself NULL.
2013-06-11 14:40:48 -07:00
Ron Dahlgren
37c8558895 Replace tabs with spaces 2013-06-11 13:10:41 -07:00
Ron Dahlgren
301f9001c0 Assert stk rather than checking null
Given that a big stack is never requested before allocating an initial
stack segment, having a non-null stk member here is an invariant.
2013-06-11 10:11:49 -07:00
Young-il Choi
febba9f418 rt: dummy function pthread_atfork for android 2013-06-11 14:52:15 +09:00
James Miller
e9c309c0e5 STATIC_PAGE_SHIFT for cross-compiling jemalloc
Sets `STATIC_PAGE_SHIFT` for cross-compiling jemalloc to 12. A
shift of 12 represents a page size of 4k for practically all
platforms.
2013-06-10 18:26:24 +12:00
Ron Dahlgren
12203a76c2 Check stk before dereferencing
This commit fixes #7022 - I've added an additional check to ensure that
stk is not null before dereferencing it to get it's next element,
assigning NULL if it is itself NULL.
2013-06-09 10:43:16 -07:00
bors
5d2cadbfea auto merge of #6895 : cmr/rust/jemalloc, r=brson 2013-06-06 18:43:37 -07:00
Brian Anderson
f9a5005f52 rt: Add rust_get_num_cpus 2013-06-06 17:53:13 -07:00
bors
533425e242 auto merge of #6053 : nikomatsakis/rust/fixme-2699, r=thestinger
r? @jld or @graydon

The calculation looks right to me, but perhaps one of you two can double check.  You two seem like you are doing the most recent work in this sort of area.
2013-06-06 13:52:41 -07:00
Alexei Sholik
e75572c879 Deduplicate words in code comments 2013-06-06 10:48:27 +03:00
Daniel Micay
cff203ef76 add jemalloc to the runtime 2013-06-01 10:45:11 -04:00
bors
e3d0c1eb0e auto merge of #6731 : thomaslee/rust/issue-6575, r=pcwalton
Fix for #6575. In the trans phase, rustc emits code for a function parameter that goes completely unused in the event the return type of the function in question happens to be an immediate.

This patch modifies rustc & parts of rustrt to ensure that the vestigial parameter is no longer present in compiled code.
2013-05-28 17:37:57 -07:00
Tom Lee
a85993ff69 Added _RUST_STAGEN guard to rust_call_tydesc_glue 2013-05-27 17:13:01 -07:00
Tom Lee
cddd274e4d Add _RUST_STAGE0 #ifdefs 2013-05-27 17:13:01 -07:00
Tom Lee
67283eaad2 Omit unused implicit argument if return type is immediate. 2013-05-27 17:13:01 -07:00
Daniel Farina
379460558b Use passing by-value in gmtime, mktime
Per the recommendation of the now-removed FIXME.
2013-05-27 10:02:48 -07:00
Alex Crichton
bf4d3729e8 Fix compilation errors with linenoise 2013-05-25 00:40:12 -05:00
Alex Crichton
876ce10264 Update the linenoise library 2013-05-24 22:32:55 -05:00
Jyun-Yan You
499b02213d fix arm stack alignment 2013-05-22 08:49:16 +08:00
bors
dc7b83d186 auto merge of #6650 : crabtw/rust/mips-rt, r=sanxiyn
Results of libcore and libstd tests

```
failures:
    rand::tests::test_rng_seeded_custom_seed2
    time::tests::run_tests
    uv_ll::test::test_uv_ll_struct_size_addrinfo
    uv_ll::test::test_uv_ll_struct_size_uv_timer_t

segfaults:
    stackwalk::test_simple
    stackwalk::test_simple_deep
```
2013-05-21 03:01:17 -07:00
Jyun-Yan You
d86a32bbb2 fix mips stack alignment 2013-05-21 11:58:30 +08:00
Brian Anderson
86ba457349 rt: Rename rust_initialize_global_state to rust_initialize_rt_tls_key 2013-05-20 15:20:50 -07:00
bors
3ee479f3e9 auto merge of #6577 : brson/rust/io-upstream, r=pcwalton
r?

This is all of my scheduler work on #4419 from the last 3 weeks or so. I've had a few failed pull requests so far but I think the problems are ironed out.

* TCP
* The beginnings of runtime embedding APIs
* Porting various corners of core to be compatible with both schedulers
* libuv timer bindings
* Further refinement of I/O error handling, including a new, incomplete, `read_error` condition
* Incomplete refactoring to make tasks work without coroutines and user-space scheduling
* Implementations of Reader/Writer extension methods
* Implementations of the most important part of core::comm

I'm particularly happy with how easy the [comm types on top of the scheduler](https://github.com/brson/rust/blob/io-upstream/src/libcore/rt/comm.rs). Note that these implementations do not use pipes. If anything here needs careful review though it's this code.

This branch passes 95% of the run-pass tests (with `TESTARGS=--newrt`)

In the next week I'll probably spend some time adding preliminary multithreading and seeing how close we are to removing the old runtime.
2013-05-18 18:37:25 -07:00
bors
d68c0279ea auto merge of #6249 : crabtw/rust/arm, r=brson
It uses the private field of TCB head to store stack limit. I tested on my Raspberry PI. A simple hello world program ran without any problem. However, for a more complex program, it segfaulted as #6231.
2013-05-17 18:19:27 -07:00
Brian Anderson
56c0b188b6 rt: Rename sched_key to rt_key
It is more general-purpose than holding scheduler pointers
2013-05-15 12:19:16 -07:00
Brian Anderson
4724966b06 core::rt: Add uv timer bindings 2013-05-15 12:19:15 -07:00
Brian Anderson
0a54bad3d1 core::rt: Initialize logging 2013-05-15 12:19:14 -07:00
Brian Anderson
f6401bad24 core: Use a global lock instead of runtime lock for os::getenv, etc. #4726 2013-05-15 12:19:14 -07:00
Brian Anderson
bfd9aa9755 core:rt: A few micro-opts 2013-05-15 12:19:14 -07:00
Brian Anderson
204e3d82cc core::rt: Register stacks with valgrind. #6428 2013-05-14 14:52:07 -07:00
Brian Anderson
101aaa3861 core::rt: 0 is a valid TLS key 2013-05-14 14:52:06 -07:00
Luqman Aden
103a68b2e7 Correct #[always_inline] -> #[inline(always)] and __attribute((...)) -> __attribute__((...)). 2013-05-13 04:05:34 -04:00
bors
fdf601eaf3 auto merge of #6358 : crabtw/rust/mips-segstk, r=brson
I changed ```RED_ZONE_SIZE``` to ```RZ_MAC_32``` because of stack canary failure.
Here is a LLVM patch for MIPS segmented stacks.
http://people.cs.nctu.edu.tw/~jyyou/rust/mips-segstk.patch

Current test results
```
failures:
    rand::tests::test_rng_seeded_custom_seed2
    run::tests::test_forced_destroy_actually_kills
    run::tests::test_unforced_destroy_actually_kills
    time::tests::run_tests
    uv_ll::test::test_uv_ll_struct_size_addrinfo
    uv_ll::test::test_uv_ll_struct_size_uv_timer_t

segfaults:
    rt::io::option::test::test_option_writer_error
    rt::local_services::test::unwind
    rt::sched::test_swap_tasks_then
    stackwalk::test_simple
    stackwalk::test_simple_deep
```
2013-05-10 04:07:50 -07:00
bors
ca95e7f94e auto merge of #6345 : seanmoon/rust/fix-typos, r=sanxiyn
Hi there,

Really enjoying Rust. Noticed a few typos so I searched around for a few more--here's some fixes.

Ran `make check` and got `summary of 24 test runs: 4868 passed; 0 failed; 330 ignored`.

Thanks!

Sean
2013-05-09 03:51:32 -07:00
Jyun-Yan You
c2bf9bf9fe improve MIPS backend and implement segmented stacks 2013-05-09 16:51:42 +08:00
Sean Moon
bd4ee7c7d2 Fix typos 2013-05-09 02:34:47 +09:00
bors
b21f37c818 auto merge of #6323 : brson/rust/nullary, r=thestinger
There's no need to delegate to C to call the Rust main function.
2013-05-08 08:39:40 -07:00
bors
e6529c36af auto merge of #6307 : brson/rust/rng2, r=brson
Closes #6280
2013-05-08 01:33:38 -07:00
Brian Anderson
80061ecb1d rt: Remove rust_call_nullary_fn
There's no need to delegate to C to call the Rust main function.
2013-05-07 23:01:05 -07:00
Brian Anderson
21aaa7fb13 rt: Eliminate the dependency on rust_kernel from rust_rng 2013-05-07 12:08:03 -07:00
Brian Anderson
4cd51c416b rt: Move win32_require out of the rust_kernel type
This is only used on rust_rng, which I am trying to extricate from
the kernel.
2013-05-07 12:08:00 -07:00
Niko Matsakis
11f7cb26c2 When autoborrowing a fn in trans, adjust the type of the datum to be &fn.
Fixes #6141.
2013-05-07 11:41:27 -04:00
Jyun-Yan You
48b6262b38 preliminary Linux ARM support 2013-05-07 13:17:14 +08:00
Niko Matsakis
8b32bde408 add rust_take_task_borrow_list and rust_set_task_borrow_list to rustrt.def.in 2013-05-06 20:10:19 -04:00
Niko Matsakis
4300d4d2fa Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze
Conflicts:
	src/libcore/core.rc
	src/libcore/hashmap.rs
	src/libcore/num/f32.rs
	src/libcore/num/f64.rs
	src/libcore/num/float.rs
	src/libcore/num/int-template.rs
	src/libcore/num/num.rs
	src/libcore/num/strconv.rs
	src/libcore/num/uint-template.rs
	src/libcore/ops.rs
	src/libcore/os.rs
	src/libcore/prelude.rs
	src/libcore/rt/mod.rs
	src/libcore/unstable/lang.rs
	src/librustc/driver/session.rs
	src/librustc/middle/astencode.rs
	src/librustc/middle/borrowck/check_loans.rs
	src/librustc/middle/borrowck/gather_loans.rs
	src/librustc/middle/borrowck/loan.rs
	src/librustc/middle/borrowck/preserve.rs
	src/librustc/middle/liveness.rs
	src/librustc/middle/mem_categorization.rs
	src/librustc/middle/region.rs
	src/librustc/middle/trans/base.rs
	src/librustc/middle/trans/inline.rs
	src/librustc/middle/trans/reachable.rs
	src/librustc/middle/typeck/check/_match.rs
	src/librustc/middle/typeck/check/regionck.rs
	src/librustc/util/ppaux.rs
	src/libstd/arena.rs
	src/libstd/ebml.rs
	src/libstd/json.rs
	src/libstd/serialize.rs
	src/libstd/std.rc
	src/libsyntax/ast_map.rs
	src/libsyntax/parse/parser.rs
	src/test/compile-fail/borrowck-uniq-via-box.rs
	src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs
	src/test/run-pass/borrowck-nested-calls.rs
2013-05-05 15:11:04 -04:00
bors
29a2a1ecd1 auto merge of #6234 : yichoi/rust/glob-dummy-pull, r=thestinger
transitional patch to resolve compile/link failure on android

after #6161 landed, I've encountered below errors since android does not support glob in libc.

/opt/ndk_standalone/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/yichoi/rust_work/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/arm-linux-androideabi/lib/libcore-c3ca5d77d81b46c1-0.7-pre.so: error: undefined reference to 'glob'

/opt/ndk_standalone/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/yichoi/rust_work/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/arm-linux-androideabi/lib/libcore-c3ca5d77d81b46c1-0.7-pre.so: error: undefined reference to 'globfre

Since android does not have `glob.h`, `glob_t` definition comes from
https://groups.google.com/forum/?fromgroups=#!topic/android-ndk/vSH6MWPD0Vk

#6100 should be resolved.
2013-05-04 22:09:36 -07:00
Young-il Choi
987ad9c878 rt: rust_android_dummy.cpp fix for make tidy 2013-05-05 14:00:53 +09:00
Niko Matsakis
bf2d3c71e3 improve DEBUG_BORROW printouts 2013-05-04 14:25:15 -04:00
Young-il Choi
7ac6571163 rt: glob, globfree dummy function for android 2013-05-04 16:00:11 +09:00
Daniel Micay
86efd97a10 add gitattributes and fix whitespace issues 2013-05-03 20:01:42 -04:00
Niko Matsakis
34024353e8 Change borrow debugging so it is disabled by -O 2013-05-03 05:42:00 -04:00
Brian Anderson
6c478c7de8 Merge remote-tracking branch 'brson/io' into incoming
Conflicts:
	mk/rt.mk
	src/libcore/run.rs
2013-05-02 20:51:56 -07:00
gareth
544ac620ba Convert most of rust_run_program.cpp to rust (issue #2674). 2013-05-02 19:26:52 +01:00
James Miller
1bd318421e Add error if RED_ZONE_SIZE doesn't get defined 2013-05-02 14:04:43 +12:00
Niko Matsakis
4af2d90af5 add an option to debug borrows (RUST_DEBUG_BORROW) so you can
find out where the offending borrow occurred. This ... still needs
some work.
2013-05-01 10:30:54 -04:00
Brian Anderson
4a4646fd54 Merge remote-tracking branch 'brson/io'
Conflicts:
	src/libcore/task/local_data_priv.rs
2013-04-30 17:01:27 -07:00
bors
9f03d45c56 auto merge of #5646 : Aatch/rust/unwind-fix, r=brson
This fixes issue #5641
2013-04-28 15:36:35 -07:00
bors
88dd53a754 auto merge of #6081 : brson/rust/out-of-stack, r=thestinger
People hit the recursion depth limit too often, it's not possible
to unwind reliably from out-of-stack.

Issues #3555, #3695
2013-04-27 16:24:34 -07:00
Brian Anderson
149047e55d rt: Set the stack depth limit to 1GB. Abort on error.
People hit the recursion depth limit too often, it's not possible
to unwind reliably from out-of-stack.

Issues #3555, #3695
2013-04-26 15:39:54 -07:00
Huon Wilson
1fc8a2f2a4 rt: use the [u]int[nn]_t types in the RNG.
This means that `ub4`s are always 4 bytes, rather than being 8 bytes on
x64. (Suggested but not implemented by upstream: "Porting it to a 64-bit
machine [...] may just need an adjustment of the definition of ub4")
2013-04-26 22:13:24 +10:00
Brian Anderson
abc49fdfae rt: abort doesn't take an argument 2013-04-25 15:10:19 -07:00
Huon Wilson
106fd12423 rt: pull upstream ISAAC code for consistency between 32/64 bit platforms
The "unsigned 4 byte" `ub4`s are actually 8 bytes on 64-bit platforms
which mean that some bits > 2**32 were retained in calculations, these
would then "reappear" after a shift and so the stream of random numbers
would differ on 32 bit vs 64 bit platforms.
2013-04-25 17:59:42 +10:00
Niko Matsakis
c20c685c34 Remove FIXME #2699---I believe the calculation is correct. Fixes #2699. 2013-04-24 20:51:50 -04:00
James Miller
286e571a63 Remove rust_unwind.h
Adds the required definitions in the correct place.
2013-04-24 18:27:56 +12:00
Brian Anderson
e944c7dade Merge remote-tracking branch 'brson/io'
This also reverts some changes to TLS that were leaking memory.

Conflicts:
	src/libcore/rt/uv/net.rs
	src/libcore/task/local_data_priv.rs
	src/libcore/unstable/lang.rs
2013-04-23 19:19:32 -07:00
gareth
91aeecf7e3 Fix issue #5976 - HANDLE leaks and undefined/bad behavour
on windows.
2013-04-23 21:23:15 +01:00
Alex Crichton
391de1c690 Remove a stray new operator in rust_task.h 2013-04-23 00:55:13 -04:00
Brian Anderson
42c0f88232 core::rt: Add unwinding to newsched tasks 2013-04-22 17:15:31 -07:00
Brian Anderson
d7f5e437a2 core::rt: Add the local heap to newsched tasks
Reusing the existing boxed_region implementation from the runtime
2013-04-21 19:03:54 -07:00
Brian Anderson
2fe118b26f rt: Don't make memory_region depend on rust_env
I am going to use memory_region and boxed_region as the local heap
in the new scheduler, for now at least, and I don't have a rust_env
available.
2013-04-21 17:42:45 -07:00
bors
3830040a89 auto merge of #5887 : jdm/rust/stackbounds, r=brson
This is needed to allow GC to work in SpiderMonkey.
2013-04-21 17:33:52 -07:00
Josh Matthews
5cc6a0bf32 rt: Make the C stack segment accessible to runtime users. 2013-04-21 22:41:43 +02:00
Brian Anderson
d24a3a4b01 core::rt: Use generated port numbers in tests 2013-04-20 01:16:06 -07:00
Brian Anderson
1f97e6d47f rt: Add rust_dbg_next_port for generating test port numbers 2013-04-20 00:24:44 -07:00
bors
8b3c09a103 auto merge of #5962 : pcwalton/rust/shootout, r=pcwalton
r? @brson
2013-04-19 19:24:52 -07:00
Brian Anderson
b96765179e core: Add rt::context for figuring out what runtime services are available
Conflicts:
	src/libcore/rt/sched/mod.rs
2013-04-19 12:05:18 -07:00
Patrick Walton
9902e798d5 rt: Remove dump_stacks 2013-04-19 12:00:08 -07:00
Patrick Walton
c995a62d44 librustc: WIP patch for using the return value. 2013-04-19 12:00:08 -07:00
Patrick Walton
ca8e99fd78 rt: Fix scalability problem with big stacks on 32 bit 2013-04-19 11:53:34 -07:00
Patrick Walton
f903ae9e72 librustc: Implement fast-ffi and use it in various places 2013-04-19 11:53:31 -07:00
bors
2a86485277 auto merge of #5418 : luqmana/rust/stack-float, r=brson
Like I commented in #2043, I can't reproduce the weirdness from #1388 on either mac or linux (x84_64) and pushing to try gives all green.

That's 128 less bytes to have to keep in the stack for every call to __morestack.
2013-04-18 13:45:55 -07:00
Marti Raudsepp
5dda8ab129 sketch: Make rust sketch barf output prettier 2013-04-18 12:46:01 +03:00
Brian Anderson
a5ddc00982 rustc: Use an out pointer to return structs in x86 C ABI. #5347
This Adds a bunch of tests for passing and returning structs
of various sizes to C. It fixes the struct return rules on unix,
and on windows for structs of size > 8 bytes. Struct passing
on unix for structs under a certain size appears to still be broken.
2013-04-17 15:49:19 -07:00
Brian Anderson
7cd681684f rt: Move test functions to rust_test_helpers.cpp 2013-04-15 13:39:15 -07:00
Jyun-Yan You
685c4d0b76 add rust_dbg_extern_identity_TwoDoubles to prevent check-fast failure 2013-04-14 13:15:46 +08:00
ILyoan
03116f251d add unwind information on morestack 2013-04-10 18:49:51 -07:00
ILyoan
3d0d144283 rust morestack assembly for arm
Conflicts:
	src/rt/arch/arm/morestack.S
2013-04-10 18:49:50 -07:00
Niko Matsakis
2a44a1bd97 Fix various warnings, NOTEs, etc 2013-04-05 05:36:03 -04:00
Jyun-Yan You
4f1d8cb6fc fix mac build and comment on stack size check 2013-04-04 18:53:58 +08:00
Jyun-Yan You
fdf48a7b52 rt: improve mips backend 2013-04-04 18:53:58 +08:00
Daniel Micay
26fc76acb6 rt/arch/arm: fix syntax used for noexec stack 2013-04-01 00:31:22 -04:00
Daniel Micay
c0be7df5de mark the assembly object stacks as non-executable
Closes #5643

This also removes the need to pass noexecstack to gcc, but that wasn't
actually working anymore.
2013-03-31 18:23:05 -04:00
bors
ef282dbe2a auto merge of #5409 : brson/rust/rt, r=brson
r?

There are a lot of commits here, but not all that much substance. Mostly just refactoring.

I started sketching out the beginnings of a very simple I/O API in `core::rt::io` that represents I/O streams as a single `Stream` trait instead of `Reader` / `Writer` pairs. This seems to be the more common pattern (at least this is how the .NET BCL does it) and it seems to me that separate readers and writers would make duplex streams very awkward. Regardless, I don't intend to go very far down the I/O API design road without some mailing list discussion.

I've also started on the uv bindings for file I/O but haven't gotten very far.

Also hooked up the new scheduler to `rust_start` and the compiletest driver. 70% of run-pass test cases already pass, but I wouldn't read too much into that.

I also split the direct, low-level uv bindings in two so that the scheduler can have its own set, leaving `std::net` on its own.
2013-03-25 13:01:11 -07:00
Brian Anderson
30d4124a37 Merge remote-tracking branch 'brson/rt'
Conflicts:
	src/libcore/rt/context.rs
	src/libcore/rt/sched.rs
	src/libcore/rt/thread.rs
	src/libcore/rt/uv.rs
2013-03-25 12:28:54 -07:00
bors
6d4499ce4d auto merge of #5424 : luqmana/rust/inline-rt, r=brson
As per #2521. Inlining seems to improve performance slightly:

                 Inlined          Not Inlined
    x86:         13.5482            14.4112
    x86_64:      17.4712            18.0696

(Average of 5 runs timed with `time`)

```Rust

fn foo() -> int {
    int::from_str(~"28098").unwrap()
}

fn main() {
    for 1000000.times {
        foo();
        foo();
        foo();
        foo();
        foo();
    }
}
```

All run on:

    Linux 3.2.0-0.bpo.4-amd64 #1 SMP Debian 3.2.35-2~bpo60+1 x86_64 GNU/Linux

The MIPS and ARM bits I didn't inline since I'm not as familiar with them and I also can't test them. All green on try.
2013-03-25 12:04:11 -07:00
Zack Corr
280b8a243e rt: Increase C_STACK_SIZE to 2MB to get JIT/rusti working again (dlopen segfaults) 2013-03-21 15:15:47 +10:00
ILyoan
c1cacc3667 Rewrite arm/ccall.s 2013-03-19 17:23:41 +09:00
Brian Anderson
5af5766512 core: Initialize global state lazily in the Scheduler ctor
I don't want any global one-time initalization functions because
that will make embedding harder.
2013-03-18 17:00:35 -07:00
Brian Anderson
044703435b Add a way to run the test suite with the new scheduler
TESTARGS=--newrt make check-stage1-rpass

Conflicts:
	src/rt/rustrt.def.in
2013-03-18 17:00:35 -07:00
Brian Anderson
54bb7226e1 core: Simplify uvll bindings and strip out currently-unused bits
No more mapping uv structs to Rust structs
2013-03-18 16:59:37 -07:00
Luqman Aden
a692777224 rt: Inline get_sp_limit/set_sp_limit/get_sp for x86. 2013-03-18 00:07:53 -07:00
Luqman Aden
d1778767cc rt: Inline get_sp_limit/set_sp_limit/get_sp for x86_64. 2013-03-17 21:40:59 -07:00
Luqman Aden
f7a14e0a5a rt: don't save and restore xmm/regs in __morestack. 2013-03-17 00:29:12 -07:00
Brian Anderson
63d18658c1 rt: Add RUST_DEBUG_MEM to rust_env to avoid races 2013-03-16 14:25:44 -07:00
bors
2293b075b8 auto merge of #5364 : xenocons/rust/patch-1, r=z0w0 2013-03-14 14:07:01 -07:00
xenocons
d8094f8602 updated from L to ull for easier mingw32 builds. 2013-03-14 09:06:33 +11:00
Niko Matsakis
efc7f82bc4 Revamp foreign code not to consider the Rust modes. This requires
adjusting a few foreign functions that were declared with by-ref
mode.  This also allows us to remove by-val mode in the near future.

With copy mode, though, we have to be careful because Rust will implicitly pass
somethings by pointer but this may not be the C ABI rules.  For example, rust
will pass a struct Foo as a Foo*.  So I added some code into the adapters to
fix this (though the C ABI rules may put the pointer back, oh well).

This patch also includes a lint mode for the use of by-ref mode
in foreign functions as the semantics of this have changed.
2013-03-13 16:59:37 -04:00
Brian Anderson
0ad3a110be Work around linkage bug cross-compiling from x86_64-apple-darwin to i686-apple-darwin
The correct opendir/readdir to use appear to be the 64-bit versions called
opendir$INODE64, etc. but for some reason I can't get them to link properly
on i686. Putting them in librustrt and making gcc figure it out works.
This mystery will have to wait for another day.
2013-03-12 21:01:40 -07:00
Brian Anderson
676e0290ed core: Add rt mod and add the new scheduler code 2013-03-11 19:44:29 -07:00
Jeff Olson
a69a2acfba rt/core: port os::list_dir to rust ref #4812 2013-03-11 15:38:55 -07:00
Jeff Olson
53db6c7e2a core: rt/core: impl os::env() in rust ref #4812 2013-03-11 15:38:55 -07:00
Jeff Olson
4bc26ce575 rt/core: impl os::getcwd() in rust ref #4812 2013-03-11 15:38:55 -07:00
Brian Anderson
81e370285f Merge remote-tracking branch 'brson/cross7'
Conflicts:
	configure
	mk/rt.mk
2013-03-06 23:54:35 -08:00
Young-il Choi
a35dc95969 mk: --android-cross-path to rustc 2013-03-05 13:12:23 +09:00
Jyun-Yan You
314605f948 rt: fix some bugs for MIPS target 2013-03-03 20:02:06 -08:00
Jyun-Yan You
0ecd9e03ff rt: MIPS32 support 2013-03-03 19:27:01 -08:00
Patrick Walton
ce3b17badd librustdoc: Remove fn@, fn~, and fn& from compiletest, fuzzer, rustdoc, and rt. rs=defun 2013-03-02 18:47:47 -08:00
bors
1d34a55d88 auto merge of #5162 : brson/rust/fixmes, r=brson 2013-03-01 01:54:38 -08:00
Brian Anderson
b01d2babaf rt: Comment out an assert in rust_kernel. #4711 2013-02-28 14:21:39 -08:00
Brian Anderson
4a04a188e3 Convert NOTEs to FIXMEs 2013-02-27 18:44:35 -08:00
Brian Anderson
1b1017087b rt: Make some runtime calls work outside of task context 2013-02-27 12:39:11 -08:00
Young-il Choi
26a5dc593c mk: rewrite make files 2013-02-27 14:53:35 +09:00
Graydon Hoare
0309af458c Put unique allocs in managed heap when they might contain managed boxes. 2013-02-21 23:01:17 -08:00
Graydon Hoare
8eaf08357c rt: remove export of symbol removed in last commit, r=burningtree 2013-02-19 07:18:46 -08:00
Graydon Hoare
968ab03026 rt: fix memory-unsafe random seed logic, r=valgrindclean 2013-02-19 07:06:36 -08:00
Daniel Micay
59bb9c2f1a rm unused reserve_vec from rt (done in libcore) 2013-02-16 02:56:00 -05:00
Daniel Micay
f34dd565d9 rm unused hash table from the runtime 2013-02-15 18:22:34 -05:00
Chris Peterson
9a76d718c7 don't deplete RNG entropy when there is only one runnable task 2013-02-14 22:35:40 -08:00
Chris Peterson
9a78dc93db reseed rust_rng after generating 32KB 2013-02-14 22:33:12 -08:00
Chris Peterson
665e900ede encapsulate isaac RNG in rust_rng struct 2013-02-14 22:31:08 -08:00