Commit Graph

20852 Commits

Author SHA1 Message Date
bors
dbaca98d78 auto merge of #8279 : pcwalton/rust/no-main, r=brson
Useful for SDL and possibly Android too.

r? @brson
2013-08-05 04:37:58 -07:00
bors
4db061160d auto merge of #8227 : dim-an/rust/tree-iter, r=thestinger 2013-08-05 02:52:55 -07:00
OGINO Masanori
eab97b5558 Add extra::arena::Arena::new{, _with_size}.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-05 17:43:40 +09:00
bors
7b2163d376 auto merge of #8303 : brson/rust/tls-magic-wtf, r=brson 2013-08-05 00:56:00 -07:00
Brian Anderson
1c1add23f6 std::rt: Use magic to make TLS work from annihilated boxes. #8302 2013-08-05 00:36:02 -07:00
bors
4fdd720421 auto merge of #8299 : brson/rust/yet-more-newsched-fixes, r=brson 2013-08-04 23:16:59 -07:00
Brian Anderson
167bdff041 std::rt: Schedule more scheduler callbacks to avoid dropping messages 2013-08-04 21:56:48 -07:00
Brian Anderson
d123df26ff std: Fix newsched logging truncation
The truncation needs to be done in the console logger in order
to catch all the logging output, and because truncation only matters
when outputting to the console.
2013-08-04 21:56:47 -07:00
darkf
180d050138 Open files in binary mode. Closes #3948 2013-08-04 21:54:24 -07:00
bors
83d2a0431c auto merge of #8220 : luqmana/rust/arm-linux, r=cmr
Update the arm linux support some more. We had a previous patch for the RasberryPi. This adds a new target `arm-unknown-linux-gnueabi` for more general arm linux support.

Build/Host machine: x86_64 Debian testing (jessie) with the `gcc-4.4-arm-linux-gnueabi` package

Tested on targets:

- TS-7800 Feroceon (ARMv5TEJ) running Debian 7.0 wheezy
- Beaglebone black (ARMv7) running Angstrom GNU/Linux v2012.12
   - rustc flags:  `--target=arm-unknown-linux-gnueabi --linker=arm-linux-gnueabi-gcc`

- Samsung Galaxy S II (to make sure android still works)
   - rustc flags:  `--target=arm-linux-androideabi --android-cross-path=[path to standalone toolchain]`

Since not all arm devices (i.e. afaik anything older than armv6 like the ts-7800 i tested on) supported getting the tls address via the `mrc` instruction, I made it also try via the magic address the kernel maps into the address space (0xFFFF0FF0). One or the other should work (and on android it seems like both work).

Also fixes a bug where rustc would always try to invoke the android assembler for any kind of arm target.
2013-08-04 21:34:54 -07:00
bors
6c12ca3ac2 auto merge of #8297 : brson/rust/dlist-dtor, r=brson
The compiler-generated dtor for DList recurses deeply to drop Nodes.
For big lists this can overflow the stack.

This is a problem for the new scheduler, where split stacks are not implemented.

Thanks @blake2-ppc
2013-08-04 19:52:57 -07:00
Brian Anderson
4898a0de04 extra: Don't recurse in DList drop glue. #8295
The compiler-generated dtor for DList recurses deeply to drop Nodes.
For big lists this can overflow the stack.
2013-08-04 18:38:06 -07:00
bors
dc5b0b9410 auto merge of #8282 : brson/rust/more-newsched-fixes, r=brson 2013-08-04 18:10:53 -07:00
Luqman Aden
9c39992021 Add support for vanilla linux on arm. 2013-08-04 19:28:06 -04:00
bors
77bc6c5955 auto merge of #8218 : brson/rust/nogc, r=brson
These are both obsoleted by the forthcoming new GC.
2013-08-04 16:25:54 -07:00
Dmitry Ermolov
28165d5ad8 Remove debug printing. 2013-08-05 02:51:43 +04:00
Dmitry Ermolov
d49bb43fc1 Implemented iterator for TrieMap
Closes #5506.
2013-08-05 02:29:51 +04:00
Daniel Micay
c327835a44 fix warning still mentioning the again keyword 2013-08-04 18:21:29 -04:00
Brian Anderson
3f4c6cead6 Remove old tests and code for select
Not compatible with newsched
2013-08-04 15:11:56 -07:00
Brian Anderson
2f8346b949 std::rt: Remove the test for context()
This is no longer testable once newsched is turned on
2013-08-04 15:11:56 -07:00
Brian Anderson
a27f339cb4 std::rt: Don't allow schedulers to exit before handling all messages
Every time run_sched_once performs a 'scheduling action' it needs to guarantee
that it runs at least one more time, so enqueue another run_sched_once callback.
The primary reason it needs to do this is because not all async callbacks
are guaranteed to run, it's only guaranteed that *a* callback will run after
enqueing one - some may get dropped.

At the moment this means we wastefully create lots of callbacks to ensure that
there will *definitely* be a callback queued up to continue running the scheduler.
The logic really needs to be tightened up here.
2013-08-04 15:11:56 -07:00
Brian Anderson
f0f7e1b3fc std::rt: 3MB stacks!
rustc needs *even more* megabytes when run without optimizations
2013-08-04 15:11:56 -07:00
Brian Anderson
75734a9cd3 std::rt: Run the tests for Local in a bare thread
Otherwise interferes with the existing runtime
2013-08-04 15:11:56 -07:00
Brian Anderson
835e963dbd std::rt: Improve the error message when the thread-local ptr is null
Also fix some incorrect comments and variable names.
2013-08-04 15:11:55 -07:00
bors
d6f2364076 auto merge of #8260 : omasanori/rust/fix-extra-unicode, r=pcwalton
WIth this patch `RUSTFLAGS='--cfg unicode' make check"` passed successfully.

* Why doesn't `#[link_name="icuuc"]` make libextra to link against libicuuc.so?
* In `extra::unicode::tests`, `use unicode; unicode::is_foo('a')` failed but `use unicode::*; is_foo('a')` succeeded. Is it right?
2013-08-04 14:43:51 -07:00
Steven Fackler
147c4fd81b Fixed str::raw::push_byte
It was previously pushing the byte on top of the string's null
terminator. I added a test to make sure it doesn't break in the future.
2013-08-04 16:19:40 -04:00
bors
3d14470be4 auto merge of #7115 : alexcrichton/rust/llvm-upgrades, r=thestinger
This is a reopening of #6713

This is still blocked on windows failures. I'll re-push try once the existing crisis has passed.
2013-08-04 12:49:53 -07:00
Daniel Micay
b49d026ecd Merge pull request #8284 from huonw/emacs-in-kw
etc: add the `in` keyword to the emacs mode.
2013-08-04 12:49:11 -07:00
Alex Crichton
60e9507086 Integrate new arm patch and fix an LLVM bug
Thanks @luqama!
2013-08-04 10:58:23 -07:00
Alex Crichton
bb93930575 Add a workaround for 8199 for now 2013-08-04 10:58:23 -07:00
Alex Crichton
4ace3b7434 Fix setting the fixed stack segment attribute on LLVM functions
At the same time create a more robust wrapper to try to prevent this type of
issue from cropping up in the future.
2013-08-04 10:58:23 -07:00
Alex Crichton
8d29367650 Fix build issues once LLVM has been upgraded
* LLVM now has a C interface to LLVMBuildAtomicRMW
* The exception handling support for the JIT seems to have been dropped
* Various interfaces have been added or headers have changed
2013-08-04 10:58:23 -07:00
Alex Crichton
1d06aaae64 Update LLVM 2013-08-04 10:58:22 -07:00
Brian Anderson
9ae0658fd0 Try to fix a periodic windows build failure due to broken rwildcard macro 2013-08-04 10:58:22 -07:00
bors
8495ee52b2 auto merge of #8262 : dotdash/rust/no_rval_copies, r=pcwalton
rvalues aren't going to be used anywhere but as the argument, so
there's no point in copying them. LLVM used to eliminate the copy
later, but why bother emitting it in the first place?
2013-08-04 10:55:53 -07:00
bors
22f9ce4df6 auto merge of #8243 : stepancheg/rust/ipv, r=brson
multicast functions now take IpAddr (without port), because they dont't
need port.

Uv* types renamed:
* UvIpAddr -> UvSocketAddr
* UvIpv4 -> UvIpv4SocketAddr
* UvIpv6 -> UvIpv6SocketAddr

"Socket address" is a common name for (ip-address, port) pair (e.g. in
sockaddr_in struct).

P. S. Are there any backward compatibility concerns? What is std::rt module, is it a part of public API?
2013-08-04 08:49:55 -07:00
bors
f7c4359a2c auto merge of #8237 : blake2-ppc/rust/faster-utf8, r=brson
Use unchecked vec indexing since the vector bounds are checked by the
loop. Iterators are not easy to use in this case since we skip 1-4 bytes
each lap. This part of the commit speeds up is_utf8 for ASCII input.

Check codepoint ranges by checking the byte ranges manually instead of
computing a full decoding for multibyte encodings. This is easy to read
and corresponds to the UTF-8 syntax in the RFC.

No changes to what we accept. A comment notes that surrogate halves are
accepted.

Before:

	test str::bench::is_utf8_100_ascii ... bench: 165 ns/iter (+/- 3)
	test str::bench::is_utf8_100_multibyte ... bench: 218 ns/iter (+/- 5)

After:
	test str::bench::is_utf8_100_ascii ... bench: 130 ns/iter (+/- 1)
	test str::bench::is_utf8_100_multibyte ... bench: 156 ns/iter (+/- 3)

An improvement upon the previous pull #8133
2013-08-04 07:10:56 -07:00
bors
5cf69d5bf8 auto merge of #8254 : brson/rust/libuv-mac-supp, r=pcwalton
I suspect that this is a race between process exit and the termination of
worker threads used by libuv (if I sleep before exit it doesn't leak). This
isn't going to cause any real problems but should probably be fixed at
some point.

r? @pcwalton

cc #8253
2013-08-04 05:28:57 -07:00
bors
91b711883c auto merge of #8217 : brson/rust/reset_stack_limit, r=pcwalton
In some scenarios upcall_rust_stack_limit fails to record the stack
limit, leaving it 0, and allowing subsequent Rust code to run into
the red zone.
2013-08-04 03:34:56 -07:00
Huon Wilson
88620c25f5 std: implement Total{Ord,Eq} for pointers. 2013-08-04 19:46:52 +10:00
Huon Wilson
8407ec9fed syntax: make #[deriving(TotalOrd)] lazy.
Previously it would call:

  f(sf1.cmp(&of1), f(sf2.cmp(&of2), ...))

(where s/of1 = 'self/other field 1', and f was
std::cmp::lexical_ordering)

This meant that every .cmp subcall got evaluated when calling a derived
TotalOrd.cmp.

This corrects this to use

   let test = sf1.cmp(&of1);
   if test == Equal {
      let test = sf2.cmp(&of2);
      if test == Equal {
        // ...
      } else {
        test
      }
   } else {
     test
   }

This gives a lexical ordering by short-circuiting on the first comparison
that is not Equal.
2013-08-04 19:46:52 +10:00
Huon Wilson
44acdad5f8 libsyntax/ext/deriving/cmp/* was ignored by the build system. 2013-08-04 19:37:29 +10:00
Dmitry Ermolov
73ec9f36e4 Implemented TreeMap::{lower_bound_iter,upper_bound_iter}
(issue #4604)
2013-08-04 13:14:13 +04:00
Dmitry Ermolov
98a66568ce Remove redundant print. 2013-08-04 13:14:13 +04:00
Dmitry Ermolov
d8e74b3dcb Additional check in treemap iterator test. 2013-08-04 13:14:13 +04:00
Brian Anderson
044fa35bf8 rt: Fix a corner-case in unwinding that leads to stack overflow
In some scenarios upcall_rust_stack_limit fails to record the stack
limit, leaving it 0, and allowing subsequent Rust code to run into
the red zone.
2013-08-03 23:40:25 -07:00
Brian Anderson
ea84c1fd69 std: Remove gc and stackwalk
These are both obsoleted by the forthcoming new GC.
2013-08-03 23:39:04 -07:00
bors
fbeeeebf47 auto merge of #8264 : thestinger/rust/snapshot, r=Aatch 2013-08-03 23:25:55 -07:00
bors
93432a2c2f auto merge of #8269 : brson/rust/fix-task-cleanup, r=brson
...y/catch

And before collect_failure. These are both running user dtors and need to be handled
in the task try/catch block and before the final task cleanup code.
2013-08-03 21:46:56 -07:00
Daniel Micay
e7bb33aed8 rm obsolete for support from the compiler 2013-08-04 00:39:48 -04:00