arena: Switch field privacy as necessary
This commit is contained in:
parent
a49ce7f11a
commit
c9024d2922
1 changed files with 8 additions and 6 deletions
|
@ -25,6 +25,8 @@
|
||||||
#![allow(missing_doc)]
|
#![allow(missing_doc)]
|
||||||
#![feature(managed_boxes)]
|
#![feature(managed_boxes)]
|
||||||
|
|
||||||
|
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
|
||||||
|
|
||||||
extern crate collections;
|
extern crate collections;
|
||||||
|
|
||||||
use std::cast::{transmute, transmute_mut, transmute_mut_region};
|
use std::cast::{transmute, transmute_mut, transmute_mut_region};
|
||||||
|
@ -83,9 +85,9 @@ pub struct Arena {
|
||||||
// The head is separated out from the list as a unbenchmarked
|
// The head is separated out from the list as a unbenchmarked
|
||||||
// microoptimization, to avoid needing to case on the list to
|
// microoptimization, to avoid needing to case on the list to
|
||||||
// access the head.
|
// access the head.
|
||||||
priv head: Chunk,
|
head: Chunk,
|
||||||
priv copy_head: Chunk,
|
copy_head: Chunk,
|
||||||
priv chunks: RefCell<Vec<Chunk>>,
|
chunks: RefCell<Vec<Chunk>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Arena {
|
impl Arena {
|
||||||
|
@ -333,14 +335,14 @@ fn test_arena_destructors_fail() {
|
||||||
/// run again for these objects.
|
/// run again for these objects.
|
||||||
pub struct TypedArena<T> {
|
pub struct TypedArena<T> {
|
||||||
/// A pointer to the next object to be allocated.
|
/// A pointer to the next object to be allocated.
|
||||||
priv ptr: *T,
|
ptr: *T,
|
||||||
|
|
||||||
/// A pointer to the end of the allocated area. When this pointer is
|
/// A pointer to the end of the allocated area. When this pointer is
|
||||||
/// reached, a new chunk is allocated.
|
/// reached, a new chunk is allocated.
|
||||||
priv end: *T,
|
end: *T,
|
||||||
|
|
||||||
/// A pointer to the first arena segment.
|
/// A pointer to the first arena segment.
|
||||||
priv first: Option<~TypedArenaChunk<T>>,
|
first: Option<~TypedArenaChunk<T>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TypedArenaChunk<T> {
|
struct TypedArenaChunk<T> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue