Skip to content

Rename raw::Box to raw::GcBox #17582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/liballoc/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use core::raw;
#[inline]
#[deprecated]
pub fn get_box_size(body_size: uint, body_align: uint) -> uint {
let header_size = mem::size_of::<raw::Box<()>>();
let header_size = mem::size_of::<raw::GcBox<()>>();
let total_size = align_to(header_size, body_align) + body_size;
total_size
}
Expand Down
8 changes: 4 additions & 4 deletions src/libcore/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

use mem;

/// The representation of a Rust managed box
pub struct Box<T> {
/// The representation of `std::gc::Gc`.
pub struct GcBox<T> {
pub ref_count: uint,
pub drop_glue: fn(ptr: *mut u8),
pub prev: *mut Box<T>,
pub next: *mut Box<T>,
pub prev: *mut GcBox<T>,
pub next: *mut GcBox<T>,
pub data: T,
}

Expand Down
2 changes: 1 addition & 1 deletion src/libdebug/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
fn visit_box(&mut self, mtbl: uint, inner: *const TyDesc) -> bool {
try!(self, self.writer.write("box(GC) ".as_bytes()));
self.write_mut_qualifier(mtbl);
self.get::<&raw::Box<()>>(|this, b| {
self.get::<&raw::GcBox<()>>(|this, b| {
let p = &b.data as *const () as *const u8;
this.visit_ptr_inner(p, inner)
})
Expand Down
6 changes: 3 additions & 3 deletions src/librustrt/local_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ use task::Task;

static RC_IMMORTAL : uint = 0x77777777;

pub type Box = raw::Box<()>;
pub type Box = raw::GcBox<()>;

pub struct MemoryRegion {
live_allocations: uint,
}

pub struct LocalHeap {
memory_region: MemoryRegion,
live_allocs: *mut raw::Box<()>,
live_allocs: *mut raw::GcBox<()>,
}

impl LocalHeap {
Expand Down Expand Up @@ -161,7 +161,7 @@ impl LocalHeap {
}

unsafe fn each_live_alloc(&mut self, read_next_before: bool,
f: |&mut LocalHeap, alloc: *mut raw::Box<()>|) {
f: |&mut LocalHeap, alloc: *mut raw::GcBox<()>|) {
//! Walks the internal list of allocations

let mut alloc = self.live_allocs;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl<T: Default + 'static> Default for Gc<T> {
}
}

impl<T: 'static> raw::Repr<*const raw::Box<T>> for Gc<T> {}
impl<T: 'static> raw::Repr<*const raw::GcBox<T>> for Gc<T> {}

impl<S: hash::Writer, T: hash::Hash<S> + 'static> hash::Hash<S> for Gc<T> {
fn hash(&self, s: &mut S) {
Expand Down