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
Chris Peterson
f4320b6195
move isaac RNG utility functions to new rust_rng.cpp file
2013-02-14 22:30:27 -08:00
Chris Peterson
c531506385
rt: rand.rs expects rust_next() to return uint32_t, not size_t
2013-02-14 22:29:21 -08:00
bors
20fd0c53ed
auto merge of #4938 : thestinger/rust/no_zero, r=brson
...
I removed the unused wrappers methods named `calloc` because they relied on the malloc wrapper having a `bool zero = true` default parameter (which resulted in some accidental zeroing). Perhaps wrapping the actual calloc function would be useful, but I don't know of an existing use case that could use it so I just removed these.
This gives an ~1% performance improvement for TreeMap, which does a lot of small allocations. Vectors use `realloc` which didn't zero before these changes so there's no measurable change in performance.
2013-02-14 18:27:54 -08:00
Daniel Micay
1a41b484bf
rm the unused calloc wrapper from memory_region
...
it doesn't actually call calloc, so it's fairly pointless
2013-02-14 18:28:04 -05:00
Daniel Micay
2e0614750c
get rid of unused exchange_alloc calloc method
...
this isn't actually calloc - it calls the malloc wrapper which no
longer zeroes
2013-02-14 18:24:52 -05:00
Daniel Micay
7103ca95ac
rm unused zero param in C++ exchange allocator
2013-02-14 16:04:30 -05:00
Luqman Aden
2c198561dd
rt: Fix alignment in debug_opaque
2013-02-13 15:41:38 -05:00
Luqman Aden
c22d0af14c
rt: take into account alignment for debug_opaque. Closes #2667
2013-02-13 15:41:38 -05:00
Luqman Aden
d67e144f68
rt: get rid of rust_fn and replace with fn_env_pair plus a little cleanup.
2013-02-13 15:41:38 -05:00
bors
6016214101
auto merge of #4900 : luqmana/rust/core_os_errors, r=graydon
...
Rewrote the last pull request (#4859 ) to not require on llvm for core.
Also fixes #2269 .
2013-02-12 21:27:22 -08:00
bors
bc2d147847
auto merge of #4858 : z0w0/rust/rm_weak_task_count, r=graydon
2013-02-12 14:36:33 -08:00
Luqman Aden
2180fe2552
rt: remove last_os_error from rustrt.def.in
2013-02-12 00:22:58 -05:00
Luqman Aden
70185fdcc2
rt: remove last_os_error and adjust tests.
2013-02-11 23:49:49 -05:00
Jeff Olson
dfcdb6eb72
rt/std: update of libuv API glue for libuv submodule update
2013-02-10 11:51:05 -08:00
Zack Corr
ebd20b7944
Rename dec/inc_weak_task_count to inc/dec_live_count and remove register_task/unregister_task. Closes #4768
2013-02-09 19:19:31 +10:00
Mark Vian
e2e474767e
rt: remove unused 'rust_compare_and_swap_ptr'. Closes #4836
2013-02-08 18:19:36 -06:00
ILyoan
e7c6735e0d
Fixed #1531
2013-02-08 14:11:00 +09:00
Brian Anderson
e43c5bdc6b
Rewrite the exchange allocator to work without an active scheduler. #4457
2013-02-06 14:27:36 -08:00
Brian Anderson
e91040c704
Make foreign calls work outside of tasks. #4451
2013-02-06 14:27:34 -08:00
Brian Anderson
a8c8bfc7b5
rt: Add rust_try_get_current_task
2013-02-06 11:56:32 -08:00
Brian Anderson
8ebdb1a11b
rt: Remove some unused upcalls
2013-02-01 21:58:33 -08:00
Brian Anderson
a50d1fdbda
rt: Remove get_frame_glue_fns. Unused
2013-02-01 21:22:49 -08:00
Brian Anderson
02fbd5a164
rt: Remove circular_buffer
2013-02-01 21:22:49 -08:00
Brian Anderson
4f6516969e
rt: Remove ports
2013-02-01 21:22:49 -08:00
ILyoan
8ec36d779b
fix #2673 : avoid visiting the same crate twice
2013-01-29 21:03:05 +09:00
Brian Anderson
1ef83945c1
Merge remote-tracking branch 'brson/nocommupstream'
...
Conflicts:
src/libcore/private.rs
src/libcore/task/mod.rs
src/libcore/task/spawn.rs
src/libstd/net_tcp.rs
src/libstd/uv_global_loop.rs
src/libstd/uv_iotask.rs
2013-01-25 18:06:30 -08:00
Brian Anderson
cc9ab2c033
Remove old comm-based weak task interface
2013-01-23 17:35:34 -08:00
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