diff options
| author | bors <bors@rust-lang.org> | 2013-02-14 18:27:54 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-02-14 18:27:54 -0800 |
| commit | 20fd0c53edd2cc5ef5d413b8698b2c5860aa4926 (patch) | |
| tree | 6b3d2071563a7d64e8bd2bb24bc988f480cd8f08 /src/libstd | |
| parent | af2f0ef0888d05209bddd16ab210ae0e8400b7de (diff) | |
| parent | 1a41b484bf05514f469e69efd56fcd7039d34db9 (diff) | |
| download | rust-20fd0c53edd2cc5ef5d413b8698b2c5860aa4926.tar.gz rust-20fd0c53edd2cc5ef5d413b8698b2c5860aa4926.zip | |
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.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/uv_ll.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/uv_ll.rs b/src/libstd/uv_ll.rs index be6b79059a9..f99b2a62f47 100644 --- a/src/libstd/uv_ll.rs +++ b/src/libstd/uv_ll.rs @@ -1253,7 +1253,7 @@ pub mod test { as *request_wrapper; let buf_base = get_base_from_buf(buf); let buf_len = get_len_from_buf(buf); - let bytes = vec::from_buf(buf_base, buf_len as uint); + let bytes = vec::from_buf(buf_base, nread as uint); let read_chan = (*client_data).read_chan.clone(); let msg_from_server = str::from_bytes(bytes); read_chan.send(msg_from_server); @@ -1445,7 +1445,7 @@ pub mod test { buf_base as uint, buf_len as uint, nread)); - let bytes = vec::from_buf(buf_base, buf_len); + let bytes = vec::from_buf(buf_base, nread as uint); let request_str = str::from_bytes(bytes); let client_data = get_data_for_uv_handle( @@ -1453,7 +1453,7 @@ pub mod test { let server_kill_msg = (*client_data).server_kill_msg; let write_req = (*client_data).server_write_req; - if (str::contains(request_str, server_kill_msg)) { + if str::contains(request_str, server_kill_msg) { log(debug, ~"SERVER: client req contains kill_msg!"); log(debug, ~"SERVER: sending response to client"); read_stop(client_stream_ptr); |
