Commit Graph

23727 Commits

Author SHA1 Message Date
Corey Richardson
a46b2b8e7a vec: with_capacity: check for overflow
Fixes #10271
2013-11-11 06:09:28 -05:00
bors
46100c0622 auto merge of #10408 : alexcrichton/rust/snapshots, r=huonw
Mostly just using the `system` abi where possible.
2013-11-10 21:56:08 -08:00
Alex Crichton
7407bcc1a2 Register new snapshots 2013-11-10 17:51:56 -08:00
bors
63cfc9989d auto merge of #10406 : alexcrichton/rust/issue-10405, r=huonw
The logging macros all use libuv-based I/O, and there was one stray debug
statement in task::spawn which was executing before the I/O context was ready.
Remove it and add a test to make sure that we can continue to debug this sort of
code.

Closes #10405
2013-11-10 16:01:12 -08:00
bors
95b46a1763 auto merge of #10226 : nibrahim/rust/docepub, r=alexcrichton
Added two new rules to create epubs out of the tutorial and reference manual source files. This is useful and doesn't add any new dependencies to the build process.
2013-11-10 14:46:04 -08:00
bors
fe48d8fcd1 auto merge of #10399 : huonw/rust/get-opt-doc, r=alexcrichton 2013-11-10 13:36:11 -08:00
Alex Crichton
b71d629744 Remove a debug! statement before I/O is ready
The logging macros all use libuv-based I/O, and there was one stray debug
statement in task::spawn which was executing before the I/O context was ready.
Remove it and add a test to make sure that we can continue to debug this sort of
code.

Closes #10405
2013-11-10 13:05:36 -08:00
bors
b5e602ac56 auto merge of #10321 : alexcrichton/rust/uv-rewrite, r=brson
The major impetus for this pull request was to remove all usage of `~fn()` in `librustuv`. This construct is going away as a language feature, and additionally it imposes the requirement that all I/O operations have at least one allocation. This allocation has been seen to have a fairly high performance impact in profiles of I/O benchmarks.

I've migrated `librustuv` away from all usage of `~fn()`, and at the same time it no longer allocates on every I/O operation anywhere. The scheduler is now much more tightly integrated with all of the libuv bindings and most of the uv callbacks are specialized functions for a certain procedure. This is a step backwards in terms of making `librustuv` usable anywhere else, but I think that the performance gains are a big win here.

In just a simple benchmark of reading/writing 4k of 0s at a time between a tcp client/server in separate processes on the same system, I have witnessed the throughput increase from ~750MB/s to ~1200MB/s with this change applied.

I'm still in the process of testing this change, although all the major bugs (to my knowledge) have been fleshed out and removed. There are still a few spurious segfaults, and that's what I'm currently investigating. In the meantime, I wanted to put this up for review to get some eyes on it other than mine. I'll update this once I've got all the tests passing reliably again.
2013-11-10 12:26:10 -08:00
Alex Crichton
e38a89d0b0 Fix usage of libuv for windows 2013-11-10 12:23:57 -08:00
Huon Wilson
8e719bdfb5 extra::getopts: update docs for minor renaming. 2013-11-10 23:28:26 +11:00
Alex Crichton
c5fdd69d3e Carefully destroy channels at the right time.
When a channel is destroyed, it may attempt scheduler operations which could
move a task off of it's I/O scheduler. This is obviously a bad interaction, and
some finesse is required to make it work (making destructors run at the right
time).

Closes #10375
2013-11-10 01:37:12 -08:00
Alex Crichton
86a321b65d Another round of test fixes from previous commits 2013-11-10 01:37:12 -08:00
Alex Crichton
3a3eefc5c3 Update to the latest libuv
At this time, also point the libuv submodule to the official repo instead of my
own off to the side.

cc #10246
Closes #10329
2013-11-10 01:37:11 -08:00
Alex Crichton
b652bbc670 Fall back from uv tty instances more aggressively
It appears that uv's support for interacting with a stdio stream as a tty when
it's actually a pipe is pretty problematic. To get around this, promote a check
to see if the stream is a tty to the top of the tty constructor, and bail out
quickly if it's not identified as a tty.

Closes #10237
2013-11-10 01:37:11 -08:00
Alex Crichton
df4c0b8e43 Make the uv bindings resilient to linked failure
In the ideal world, uv I/O could be canceled safely at any time. In reality,
however, we are unable to do this. Right now linked failure is fairly flaky as
implemented in the runtime, making it very difficult to test whether the linked
failure mechanisms inside of the uv bindings are ready for this kind of
interaction.

Right now, all constructors will execute in a task::unkillable block, and all
homing I/O operations will prevent linked failure in the duration of the homing
operation. What this means is that tasks which perform I/O are still susceptible
to linked failure, but the I/O operations themselves will never get interrupted.
Instead, the linked failure will be received at the edge of the I/O operation.
2013-11-10 01:37:11 -08:00
Alex Crichton
5e6bbc6bfa Assorted test fixes and merge conflicts 2013-11-10 01:37:11 -08:00
Alex Crichton
b545751597 Rework the idle callback to have a safer interface
It turns out that the uv implementation would cause use-after-free if the idle
callback was used after the call to `close`, and additionally nothing would ever
really work that well if `start()` were called twice. To change this, the
`start` and `close` methods were removed in favor of specifying the callback at
creation, and allowing destruction to take care of closing the watcher.
2013-11-10 01:37:11 -08:00
Alex Crichton
d08aadcc9a Update all uv tests to pass again 2013-11-10 01:37:11 -08:00
Alex Crichton
0df8b0057c Work around bugs in 32-bit enum FFI
cc #10308
2013-11-10 01:37:11 -08:00
Alex Crichton
1bdaea827e Migrate all streams to synchronous closing 2013-11-10 01:37:11 -08:00
Alex Crichton
f9abd998d6 Add bindings to uv's utime function
This exposes the ability to change the modification and access times on a file.

Closes #10266
2013-11-10 01:37:11 -08:00
Alex Crichton
497d63f0bc Don't overflow in a converting stat times to u64
Closes #10297
2013-11-10 01:37:11 -08:00
Alex Crichton
aa78c3d6f6 Clean up the remaining chunks of uv 2013-11-10 01:37:11 -08:00
Alex Crichton
584b359348 Migrate uv net bindings away from ~fn() 2013-11-10 01:37:11 -08:00
Alex Crichton
5842b606a7 Migrate uv getaddrinfo away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
be896288a3 Migrate uv file bindings away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
c1b5c4db8f Start migrating stream I/O away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
6690bcb101 Fixing rebase conflicts and such
This cleans up the merging of removing ~fn() and removing C++ wrappers to a
compile-able and progress-ready state
2013-11-10 01:37:10 -08:00
Alex Crichton
18ce014e9d Remove usage of ~fn from the scheduler 2013-11-10 01:37:10 -08:00
Alex Crichton
28219fc679 Remove usage of ~fn() from uv async/idle 2013-11-10 01:37:10 -08:00
Alex Crichton
9286d5113d Migrate uv signal handling away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
ceab326e82 Migrate uv process bindings away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
24b4223418 Migrate uv timer bindings away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
653406fcf7 uv: Remove closure-based home_for_io for raii
Using an raii wrapper means that there's no need for a '_self' variant and we
can greatly reduce the amount of 'self_'-named variables.
2013-11-10 01:37:10 -08:00
Alex Crichton
4bcde6bc06 uv: Provide a helper fn to Result<(), IoError> 2013-11-10 01:37:10 -08:00
Alex Crichton
30c885ea52 uv: Remove lots of uv/C++ wrappers 2013-11-10 01:37:10 -08:00
bors
3851f908d1 auto merge of #10367 : alexcrichton/rust/system-abi, r=nikomatsakis
This adds an other ABI option which allows a custom selection over the target
architecture and OS. The only current candidate for this change is that kernel32
on win32 uses stdcall, but on win64 it uses the cdecl calling convention.
Otherwise everywhere else this is defined as using the Cdecl calling convention.

cc #10049
Closes #8774
2013-11-09 12:26:12 -08:00
Alex Crichton
2fcc70ec9d Add a "system" ABI
This adds an other ABI option which allows a custom selection over the target
architecture and OS. The only current candidate for this change is that kernel32
on win32 uses stdcall, but on win64 it uses the cdecl calling convention.
Otherwise everywhere else this is defined as using the Cdecl calling convention.

cc #10049
Closes #8774
2013-11-09 11:16:09 -08:00
bors
8379890c05 auto merge of #10153 : nikomatsakis/rust/issue-4846-multiple-lifetime-parameters-7, r=pnkfelix
Fully support multiple lifetime parameters on types and elsewhere, removing special treatment for `'self`. I am submitting this a touch early in that I plan to push a new commit with more tests specifically targeting types with multiple lifetime parameters -- but the current code bootstraps and passes `make check`.

Fixes #4846
2013-11-09 08:36:09 -08:00
Niko Matsakis
f6e8d49a1a Make irrelevant changes to regions-mock-tcx to convince the pretty printer to emit the same thing twice in a row 2013-11-09 11:34:05 -05:00
Niko Matsakis
a15196c53b Make main public to accommodate check-fast 2013-11-09 09:13:58 -05:00
bors
dc5d9b908f auto merge of #10372 : catamorphism/rust/rustpkg-issue-9311, r=catamorphism
and use opt_str instead of opt_val in rustpkg

Closes #9311
2013-11-09 06:11:10 -08:00
Niko Matsakis
b32845d984 xfail-fast regions-mock-tcx.rs 2013-11-09 07:57:10 -05:00
bors
7bb668defd auto merge of #10371 : catamorphism/rust/rustpkg-issue-9482, r=catamorphism
This bug was already fixed, just needed a test.

Closes #9569
2013-11-09 04:11:13 -08:00
bors
4f68d1365a auto merge of #10368 : tautologico/rust/default_pkgid, r=catamorphism
This Fixes #10265 and paves the way for fixing #9543. It works by adding a 'package_id' attribute by default for library crates that don't specify it. This is necessary to use the 'extern mod foo = "bar"' form instead of 'extern mod foo(name="bar") (as per #9543), because the former adds a required package_id when trying to link with the bar crate. I added a simple test to ensure that the default package_id value is being generated, and also added an explicit package_id in the link attribute in all rust libs to avoid getting warnings about default package_id values when building rust.
2013-11-09 02:11:15 -08:00
bors
162ba894bc auto merge of #10359 : tomassedovic/rust/typeid-iterbytes, r=pcwalton
I'm not sure this is something you're interested in, but I was playing around the Any trait a bit and I wanted to try it as a key in a HashMap. To do that, TypeId needs to implement IterBytes.
2013-11-09 00:51:16 -08:00
bors
785f9b8c16 auto merge of #10358 : cmr/rust/mmap++, r=alexcrichton 2013-11-08 23:41:18 -08:00
Corey Richardson
658e20e2da std: os: Document MemoryMap 2013-11-09 00:58:27 -05:00
bors
d14a647dc3 auto merge of #10376 : thestinger/rust/clone, r=huonw
Closes #10240
2013-11-08 20:31:23 -08:00
Daniel Micay
6943ca8dcd make DeepClone inherit from Clone 2013-11-08 23:26:53 -05:00