Skip to content

Commit b83e5fd

Browse files
committed
---
yaml --- r: 63517 b: refs/heads/snap-stage3 c: 1a8969f h: refs/heads/master i: 63515: 0eb72e7 v: v3
1 parent a0d95f8 commit b83e5fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+873
-534
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: dc262d9aa742adadb92558a588aeaa57267fdee4
4+
refs/heads/snap-stage3: 1a8969f64be0a7e7a2cd61f04d6c4d94abe35c75
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/mk/tests.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ CFG_ADB_TEST_DIR=/data/tmp
122122
$(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
123123
$(shell adb remount 1>/dev/null) \
124124
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR) 1>/dev/null) \
125-
$(shell adb shell rm -rf $(CFG_ADB_TEST_DIR)/* 1>/dev/null) \
125+
$(shell adb shell rm $(CFG_ADB_TEST_DIR)/*.so 1>/dev/null) \
126+
$(shell adb shell rm $(CFG_ADB_TEST_DIR)/*-arm-linux-androideabi 1>/dev/null) \
127+
$(shell adb shell rm $(CFG_ADB_TEST_DIR)/*-arm-linux-androideabi.* 1>/dev/null) \
126128
$(shell adb push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
127129
$(shell adb push $(CFG_ANDROID_CROSS_PATH)/arm-linux-androideabi/lib/armv7-a/libgnustl_shared.so \
128130
$(CFG_ADB_TEST_DIR) 1>/dev/null) \

branches/snap-stage3/src/etc/adb_run_wrapper.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,16 @@ then
1717

1818
L_RET=1
1919
L_COUNT=0
20-
cd $PATH
2120
while [ $L_RET -eq 1 ]
2221
do
23-
TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$PATH $PATH/$RUN $@ 1>$PATH/$RUN.stdout 2>$PATH/$RUN.stderr
22+
LD_LIBRARY_PATH=$PATH $PATH/$RUN $@ 1>$PATH/$RUN.stdout 2>$PATH/$RUN.stderr
2423
L_RET=$?
2524
if [ $L_COUNT -gt 0 ]
2625
then
2726
/system/bin/sleep $WAIT
2827
/system/bin/sync
2928
fi
30-
L_COUNT=$((L_COUNT+1))
29+
L_COUNT=`expr $L_COUNT+1`
3130
done
3231

3332
echo $L_RET > $PATH/$RUN.exitcode

branches/snap-stage3/src/libextra/arc.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,15 @@ impl<T:Owned> MutexARC<T> {
200200
*/
201201
#[inline]
202202
pub unsafe fn access<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
203-
let state = self.x.get();
204-
// Borrowck would complain about this if the function were
205-
// not already unsafe. See borrow_rwlock, far below.
206-
do (&(*state).lock).lock {
207-
check_poison(true, (*state).failed);
208-
let _z = PoisonOnFail(&mut (*state).failed);
209-
blk(&mut (*state).data)
203+
unsafe {
204+
let state = self.x.get();
205+
// Borrowck would complain about this if the function were
206+
// not already unsafe. See borrow_rwlock, far below.
207+
do (&(*state).lock).lock {
208+
check_poison(true, (*state).failed);
209+
let _z = PoisonOnFail(&mut (*state).failed);
210+
blk(&mut (*state).data)
211+
}
210212
}
211213
}
212214

branches/snap-stage3/src/libextra/flatpipes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ pub mod bytepipes {
516516
use core::comm::{Port, Chan};
517517
use core::comm;
518518
use core::io::{Writer, Reader, ReaderUtil};
519+
use core::vec;
519520

520521
pub struct ReaderBytePort<R> {
521522
reader: R

branches/snap-stage3/src/libextra/net_tcp.rs

Lines changed: 137 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -181,88 +181,90 @@ pub fn connect(input_ip: ip::IpAddr, port: uint,
181181
debug!("stream_handle_ptr outside interact %?",
182182
stream_handle_ptr);
183183
do iotask::interact(iotask) |loop_ptr| {
184-
debug!("in interact cb for tcp client connect..");
185-
debug!("stream_handle_ptr in interact %?",
186-
stream_handle_ptr);
187-
match uv::ll::tcp_init( loop_ptr, stream_handle_ptr) {
188-
0i32 => {
189-
debug!("tcp_init successful");
190-
debug!("dealing w/ ipv4 connection..");
191-
let connect_req_ptr: *uv::ll::uv_connect_t =
192-
&(*socket_data_ptr).connect_req;
193-
let addr_str = ip::format_addr(&input_ip);
194-
let connect_result = match input_ip {
195-
ip::Ipv4(ref addr) => {
196-
// have to "recreate" the
197-
// sockaddr_in/6 since the ip_addr
198-
// discards the port info.. should
199-
// probably add an additional rust
200-
// type that actually is closer to
201-
// what the libuv API expects (ip str
202-
// + port num)
203-
debug!("addr: %?", addr);
204-
let in_addr = uv::ll::ip4_addr(addr_str,
205-
port as int);
206-
uv::ll::tcp_connect(
207-
connect_req_ptr,
208-
stream_handle_ptr,
209-
&in_addr,
210-
tcp_connect_on_connect_cb)
211-
}
212-
ip::Ipv6(ref addr) => {
213-
debug!("addr: %?", addr);
214-
let in_addr = uv::ll::ip6_addr(addr_str,
215-
port as int);
216-
uv::ll::tcp_connect6(
217-
connect_req_ptr,
218-
stream_handle_ptr,
219-
&in_addr,
220-
tcp_connect_on_connect_cb)
221-
}
222-
};
223-
match connect_result {
224-
0i32 => {
225-
debug!("tcp_connect successful: \
226-
stream %x,
227-
socket data %x",
228-
stream_handle_ptr as uint,
229-
socket_data_ptr as uint);
230-
// reusable data that we'll have for the
231-
// duration..
232-
uv::ll::set_data_for_uv_handle(
233-
stream_handle_ptr,
234-
socket_data_ptr as
235-
*libc::c_void);
236-
// just so the connect_cb can send the
237-
// outcome..
238-
uv::ll::set_data_for_req(connect_req_ptr,
239-
conn_data_ptr);
240-
debug!("leaving tcp_connect interact cb...");
241-
// let tcp_connect_on_connect_cb send on
242-
// the result_ch, now..
243-
}
244-
_ => {
245-
// immediate connect
246-
// failure.. probably a garbage ip or
247-
// somesuch
248-
let err_data =
249-
uv::ll::get_last_err_data(loop_ptr);
250-
let result_ch = (*conn_data_ptr)
251-
.result_ch.clone();
252-
result_ch.send(ConnFailure(err_data));
253-
uv::ll::set_data_for_uv_handle(
254-
stream_handle_ptr,
255-
conn_data_ptr);
256-
uv::ll::close(stream_handle_ptr,
257-
stream_error_close_cb);
184+
unsafe {
185+
debug!("in interact cb for tcp client connect..");
186+
debug!("stream_handle_ptr in interact %?",
187+
stream_handle_ptr);
188+
match uv::ll::tcp_init( loop_ptr, stream_handle_ptr) {
189+
0i32 => {
190+
debug!("tcp_init successful");
191+
debug!("dealing w/ ipv4 connection..");
192+
let connect_req_ptr: *uv::ll::uv_connect_t =
193+
&(*socket_data_ptr).connect_req;
194+
let addr_str = ip::format_addr(&input_ip);
195+
let connect_result = match input_ip {
196+
ip::Ipv4(ref addr) => {
197+
// have to "recreate" the
198+
// sockaddr_in/6 since the ip_addr
199+
// discards the port info.. should
200+
// probably add an additional rust
201+
// type that actually is closer to
202+
// what the libuv API expects (ip str
203+
// + port num)
204+
debug!("addr: %?", addr);
205+
let in_addr = uv::ll::ip4_addr(addr_str,
206+
port as int);
207+
uv::ll::tcp_connect(
208+
connect_req_ptr,
209+
stream_handle_ptr,
210+
&in_addr,
211+
tcp_connect_on_connect_cb)
212+
}
213+
ip::Ipv6(ref addr) => {
214+
debug!("addr: %?", addr);
215+
let in_addr = uv::ll::ip6_addr(addr_str,
216+
port as int);
217+
uv::ll::tcp_connect6(
218+
connect_req_ptr,
219+
stream_handle_ptr,
220+
&in_addr,
221+
tcp_connect_on_connect_cb)
222+
}
223+
};
224+
match connect_result {
225+
0i32 => {
226+
debug!("tcp_connect successful: \
227+
stream %x,
228+
socket data %x",
229+
stream_handle_ptr as uint,
230+
socket_data_ptr as uint);
231+
// reusable data that we'll have for the
232+
// duration..
233+
uv::ll::set_data_for_uv_handle(
234+
stream_handle_ptr,
235+
socket_data_ptr as
236+
*libc::c_void);
237+
// just so the connect_cb can send the
238+
// outcome..
239+
uv::ll::set_data_for_req(connect_req_ptr,
240+
conn_data_ptr);
241+
debug!("leaving tcp_connect interact cb...");
242+
// let tcp_connect_on_connect_cb send on
243+
// the result_ch, now..
244+
}
245+
_ => {
246+
// immediate connect
247+
// failure.. probably a garbage ip or
248+
// somesuch
249+
let err_data =
250+
uv::ll::get_last_err_data(loop_ptr);
251+
let result_ch = (*conn_data_ptr)
252+
.result_ch.clone();
253+
result_ch.send(ConnFailure(err_data));
254+
uv::ll::set_data_for_uv_handle(
255+
stream_handle_ptr,
256+
conn_data_ptr);
257+
uv::ll::close(stream_handle_ptr,
258+
stream_error_close_cb);
259+
}
258260
}
259261
}
260-
}
261-
_ => {
262-
// failure to create a tcp handle
263-
let err_data = uv::ll::get_last_err_data(loop_ptr);
264-
let result_ch = (*conn_data_ptr).result_ch.clone();
265-
result_ch.send(ConnFailure(err_data));
262+
_ => {
263+
// failure to create a tcp handle
264+
let err_data = uv::ll::get_last_err_data(loop_ptr);
265+
let result_ch = (*conn_data_ptr).result_ch.clone();
266+
result_ch.send(ConnFailure(err_data));
267+
}
266268
}
267269
}
268270
}
@@ -1013,12 +1015,14 @@ fn tear_down_socket_data(socket_data: @TcpSocketData) {
10131015
let close_data_ptr: *TcpSocketCloseData = &close_data;
10141016
let stream_handle_ptr = (*socket_data).stream_handle_ptr;
10151017
do iotask::interact(&(*socket_data).iotask) |loop_ptr| {
1016-
debug!(
1017-
"interact dtor for tcp_socket stream %? loop %?",
1018-
stream_handle_ptr, loop_ptr);
1019-
uv::ll::set_data_for_uv_handle(stream_handle_ptr,
1020-
close_data_ptr);
1021-
uv::ll::close(stream_handle_ptr, tcp_socket_dtor_close_cb);
1018+
unsafe {
1019+
debug!(
1020+
"interact dtor for tcp_socket stream %? loop %?",
1021+
stream_handle_ptr, loop_ptr);
1022+
uv::ll::set_data_for_uv_handle(stream_handle_ptr,
1023+
close_data_ptr);
1024+
uv::ll::close(stream_handle_ptr, tcp_socket_dtor_close_cb);
1025+
}
10221026
};
10231027
closed_po.recv();
10241028
//the line below will most likely crash
@@ -1078,17 +1082,19 @@ fn read_stop_common_impl(socket_data: *TcpSocketData) ->
10781082
let stream_handle_ptr = (*socket_data).stream_handle_ptr;
10791083
let (stop_po, stop_ch) = stream::<Option<TcpErrData>>();
10801084
do iotask::interact(&(*socket_data).iotask) |loop_ptr| {
1081-
debug!("in interact cb for tcp::read_stop");
1082-
match uv::ll::read_stop(stream_handle_ptr
1083-
as *uv::ll::uv_stream_t) {
1084-
0i32 => {
1085-
debug!("successfully called uv_read_stop");
1086-
stop_ch.send(None);
1087-
}
1088-
_ => {
1089-
debug!("failure in calling uv_read_stop");
1090-
let err_data = uv::ll::get_last_err_data(loop_ptr);
1091-
stop_ch.send(Some(err_data.to_tcp_err()));
1085+
unsafe {
1086+
debug!("in interact cb for tcp::read_stop");
1087+
match uv::ll::read_stop(stream_handle_ptr
1088+
as *uv::ll::uv_stream_t) {
1089+
0i32 => {
1090+
debug!("successfully called uv_read_stop");
1091+
stop_ch.send(None);
1092+
}
1093+
_ => {
1094+
debug!("failure in calling uv_read_stop");
1095+
let err_data = uv::ll::get_last_err_data(loop_ptr);
1096+
stop_ch.send(Some(err_data.to_tcp_err()));
1097+
}
10921098
}
10931099
}
10941100
}
@@ -1108,20 +1114,22 @@ fn read_start_common_impl(socket_data: *TcpSocketData)
11081114
let (start_po, start_ch) = stream::<Option<uv::ll::uv_err_data>>();
11091115
debug!("in tcp::read_start before interact loop");
11101116
do iotask::interact(&(*socket_data).iotask) |loop_ptr| {
1111-
debug!("in tcp::read_start interact cb %?",
1112-
loop_ptr);
1113-
match uv::ll::read_start(stream_handle_ptr
1114-
as *uv::ll::uv_stream_t,
1115-
on_alloc_cb,
1116-
on_tcp_read_cb) {
1117-
0i32 => {
1118-
debug!("success doing uv_read_start");
1119-
start_ch.send(None);
1120-
}
1121-
_ => {
1122-
debug!("error attempting uv_read_start");
1123-
let err_data = uv::ll::get_last_err_data(loop_ptr);
1124-
start_ch.send(Some(err_data));
1117+
unsafe {
1118+
debug!("in tcp::read_start interact cb %?",
1119+
loop_ptr);
1120+
match uv::ll::read_start(stream_handle_ptr
1121+
as *uv::ll::uv_stream_t,
1122+
on_alloc_cb,
1123+
on_tcp_read_cb) {
1124+
0i32 => {
1125+
debug!("success doing uv_read_start");
1126+
start_ch.send(None);
1127+
}
1128+
_ => {
1129+
debug!("error attempting uv_read_start");
1130+
let err_data = uv::ll::get_last_err_data(loop_ptr);
1131+
start_ch.send(Some(err_data));
1132+
}
11251133
}
11261134
}
11271135
}
@@ -1158,22 +1166,24 @@ fn write_common_impl(socket_data_ptr: *TcpSocketData,
11581166
};
11591167
let write_data_ptr: *WriteReqData = &write_data;
11601168
do iotask::interact(&(*socket_data_ptr).iotask) |loop_ptr| {
1161-
debug!("in interact cb for tcp::write %?",
1162-
loop_ptr);
1163-
match uv::ll::write(write_req_ptr,
1164-
stream_handle_ptr,
1165-
write_buf_vec_ptr,
1166-
tcp_write_complete_cb) {
1167-
0i32 => {
1168-
debug!("uv_write() invoked successfully");
1169-
uv::ll::set_data_for_req(write_req_ptr,
1170-
write_data_ptr);
1171-
}
1172-
_ => {
1173-
debug!("error invoking uv_write()");
1174-
let err_data = uv::ll::get_last_err_data(loop_ptr);
1175-
let result_ch = (*write_data_ptr).result_ch.clone();
1176-
result_ch.send(TcpWriteError(err_data.to_tcp_err()));
1169+
unsafe {
1170+
debug!("in interact cb for tcp::write %?",
1171+
loop_ptr);
1172+
match uv::ll::write(write_req_ptr,
1173+
stream_handle_ptr,
1174+
write_buf_vec_ptr,
1175+
tcp_write_complete_cb) {
1176+
0i32 => {
1177+
debug!("uv_write() invoked successfully");
1178+
uv::ll::set_data_for_req(write_req_ptr,
1179+
write_data_ptr);
1180+
}
1181+
_ => {
1182+
debug!("error invoking uv_write()");
1183+
let err_data = uv::ll::get_last_err_data(loop_ptr);
1184+
let result_ch = (*write_data_ptr).result_ch.clone();
1185+
result_ch.send(TcpWriteError(err_data.to_tcp_err()));
1186+
}
11771187
}
11781188
}
11791189
}

branches/snap-stage3/src/libextra/num/complex.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ impl<T: Clone + Num> Cmplx<T> {
8080
}
8181
}
8282

83+
#[cfg(not(stage0))] // Fixed by #4228
8384
impl<T: Clone + Algebraic + Num> Cmplx<T> {
8485
/// Calculate |self|
8586
#[inline]
@@ -88,6 +89,7 @@ impl<T: Clone + Algebraic + Num> Cmplx<T> {
8889
}
8990
}
9091

92+
#[cfg(not(stage0))] // Fixed by #4228
9193
impl<T: Clone + Trigonometric + Algebraic + Num> Cmplx<T> {
9294
/// Calculate the principal Arg of self.
9395
#[inline]

0 commit comments

Comments
 (0)