Address nits by @catamorphism

This commit is contained in:
Niko Matsakis 2013-06-21 05:56:35 -04:00
parent af453a33cc
commit 59083d2c6a
3 changed files with 5 additions and 9 deletions

View File

@ -143,7 +143,7 @@ pub unsafe fn set_memory<T>(dst: *mut T, c: u8, count: uint) {
}
/**
* Zeroes out `count` bytes of memory at `dst`
* Zeroes out `count * size_of::<T>` bytes of memory at `dst`
*/
#[inline]
#[cfg(not(stage0))]

View File

@ -39,10 +39,6 @@ rust_opaque_box *boxed_region::malloc(type_desc *td, size_t body_size) {
rust_opaque_box *boxed_region::realloc(rust_opaque_box *box,
size_t new_size) {
// We also get called on the unique-vec-in-managed-heap path.
// assert(box->ref_count == 1 ||
// box->ref_count == (size_t)(-2));
size_t total_size = new_size + sizeof(rust_opaque_box);
rust_opaque_box *new_box =
(rust_opaque_box*)backing_region->realloc(box, total_size);

View File

@ -29,13 +29,13 @@
fn main() {
let a = @mut 3i;
// let b = @mut [a];
// let c = @mut [3];
let b = @mut [a];
let c = @mut [3];
// this should freeze `a` only
let _x: &mut int = a;
// hence these writes should not fail:
// b[0] = b[0];
// c[0] = c[0];
b[0] = b[0];
c[0] = c[0];
}