Commit 10495f88 authored by qinsoon's avatar qinsoon

remove warnings

parent ef467bc0
......@@ -14,14 +14,8 @@
use utils::Address;
use utils::ByteSize;
use utils::POINTER_SIZE;
use common::gctype::*;
use MY_GC;
use objectmodel;
use std::collections::HashMap;
use std::sync::Arc;
pub struct HeapDump {
pub objects: HashMap<Address, ObjectDump>,
......@@ -63,6 +57,7 @@ impl HeapDump {
}
#[cfg(feature = "use-sidemap")]
#[allow(unused_variables)]
fn persist_object(&self, obj: Address) -> ObjectDump {
unimplemented!()
}
......
......@@ -13,7 +13,6 @@
// limitations under the License.
use utils::Address;
use utils::ByteSize;
use std::ops::Deref;
use std::ops::DerefMut;
use std::fmt;
......
......@@ -13,7 +13,6 @@
// limitations under the License.
use utils::Address;
use heap::gc;
use heap::immix;
use heap::Mutator;
mod malloc_list;
......
......@@ -109,6 +109,7 @@ impl FreeListSpace {
#[inline(always)]
#[cfg(feature = "use-sidemap")]
#[allow(unused_variables)]
fn is_traced(&self, addr: Address, mark_state: u8) -> bool {
unimplemented!()
}
......
......@@ -13,14 +13,9 @@
// limitations under the License.
use heap::*;
use heap::immix::*;
use heap::freelist::FreeListSpace;
use objectmodel;
use objectmodel::sidemap::*;
use common::gctype::*;
use MY_GC;
use utils::*;
use utils::bit_utils;
use std::sync::atomic::{AtomicIsize, AtomicBool, Ordering};
use std::sync::{Arc, Mutex, Condvar, RwLock};
......
......@@ -16,17 +16,10 @@ use heap::Mutator;
use heap::immix::*;
use heap::immix::ImmixSpace;
use heap::immix::immix_space::ImmixBlock;
use heap::gc;
use objectmodel;
use objectmodel::sidemap::*;
use utils::Address;
use utils::ByteSize;
use common::ptr::*;
use std::*;
use std::sync::Arc;
use std::sync::RwLock;
use std::sync::atomic::{AtomicBool, Ordering};
const TRACE_ALLOC: bool = false;
......@@ -173,6 +166,7 @@ impl ImmixAllocator {
#[inline(always)]
#[cfg(feature = "use-sidemap")]
#[allow(unused_variables)]
pub fn init_hybrid<T>(&mut self, addr: Address, encode: T, len: u64) {
unimplemented!()
}
......
......@@ -12,46 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use common::AddressMap;
use common::ptr::*;
use heap::*;
use heap::immix::*;
use heap::gc;
use objectmodel::sidemap::*;
use utils::*;
use utils::mem::malloc_zero;
use utils::mem::memmap;
use utils::mem::memsec;
use std::*;
use std::collections::LinkedList;
use std::sync::Mutex;
use std::sync::Arc;
const TRACE_ALLOC: bool = true;
#[repr(C, packed)]
#[derive(Copy, Clone)]
/// Every Immix block owns its own segment of the line mark table
pub struct BlockLineMarkTable {
ptr: *mut LineMark
}
impl BlockLineMarkTable {
#[inline(always)]
pub fn get(&self, index: u8) -> LineMark {
unsafe { *self.ptr.offset(index as isize) }
}
#[inline(always)]
pub fn set(&mut self, index: u8, value: LineMark) {
unsafe { *self.ptr.offset(index as isize) = value };
}
#[inline(always)]
pub fn len(&self) -> u8 {
LINES_IN_BLOCK as u8
}
}
/// An ImmixSpace represents a memory area that is used for immix heap and also its meta data
///
/// Memory layout
......@@ -232,7 +205,7 @@ impl ImmixSpace {
let line_start = (cur_addr - self.mem_start()) >> LOG_BYTES_IN_LINE;
let block_start = self.cur_blocks;
for i in 0..n_blocks {
for _ in 0..n_blocks {
let block: Raw<ImmixBlock> = unsafe { Raw::from_addr(cur_addr) };
// add to usable blocks
lock.push_back(block);
......@@ -401,7 +374,7 @@ impl ImmixSpace {
let mut live_blocks: LinkedList<Raw<ImmixBlock>> = LinkedList::new();
while !used_blocks_lock.is_empty() {
let mut block = used_blocks_lock.pop_front().unwrap();
let block = used_blocks_lock.pop_front().unwrap();
let line_index = self.get_line_mark_index(block.mem_start());
let block_index = self.get_block_mark_index(block.mem_start());
......
......@@ -14,7 +14,6 @@
use utils::*;
use heap::*;
use std::mem::size_of;
mod immix_space;
mod immix_mutator;
......
......@@ -13,8 +13,6 @@
// limitations under the License.
use utils::*;
use utils::bit_utils;
use objectmodel;
use common::ptr::*;
use heap::immix::*;
......
......@@ -87,14 +87,11 @@ use heap::*;
use heap::immix::BYTES_IN_LINE;
use heap::immix::ImmixSpace;
use heap::immix::ImmixAllocator;
use heap::freelist;
use heap::freelist::FreeListSpace;
use utils::LinkedHashSet;
use utils::Address;
use utils::ObjectReference;
use objectmodel::sidemap::*;
use std::fmt;
use std::sync::Arc;
use std::sync::RwLock;
use std::sync::atomic::Ordering;
......@@ -328,6 +325,7 @@ pub extern "C" fn muentry_alloc_normal_slow(
/// allocates an object in the freelist space (large object space)
#[no_mangle]
#[inline(never)]
#[allow(unused_variables)]
pub extern "C" fn muentry_alloc_large(
mutator: *mut Mutator,
size: usize,
......@@ -371,10 +369,10 @@ pub extern "C" fn muentry_alloc_any(
/// initializes a fix-sized object
#[no_mangle]
#[inline(always)]
pub extern "C" fn muentry_init_tiny_object<T>(
pub extern "C" fn muentry_init_tiny_object(
mutator: *mut Mutator,
obj: ObjectReference,
encode: T
encode: TinyObjectEncode
) {
unsafe { &mut *mutator }
.tiny
......
......@@ -55,18 +55,18 @@ const SMALL_ENTRY_CAP: usize = 1 << SMALL_ID_WIDTH;
const LARGE_ENTRY_CAP: usize = N_TYPES;
/// storing a pointer to the actual type table
static global_type_table_ptr: AtomicUsize = ATOMIC_USIZE_INIT;
static GLOBAL_TYPE_TABLE_PTR: AtomicUsize = ATOMIC_USIZE_INIT;
/// storing a pointer to the metadata of the type table
static global_type_table_meta: AtomicUsize = ATOMIC_USIZE_INIT;
static GLOBAL_TYPE_TABLE_META: AtomicUsize = ATOMIC_USIZE_INIT;
/// save Mmap to keep the memory map alive
// it is okay to use lock here, as we won't actually access this field
lazy_static!{
static ref gtt_mmap: Mutex<Option<memmap::MmapMut>> = Mutex::new(None);
static ref GTT_MMAP: Mutex<Option<memmap::MmapMut>> = Mutex::new(None);
}
impl GlobalTypeTable {
pub fn init() {
let mut mmap_lock = gtt_mmap.lock().unwrap();
let mut mmap_lock = GTT_MMAP.lock().unwrap();
assert!(mmap_lock.is_none());
let entry_size = mem::size_of::<TypeEncode>();
......@@ -81,10 +81,10 @@ impl GlobalTypeTable {
// start address of metadata
let meta_addr = Address::from_ptr::<u8>(mmap.as_mut_ptr());
global_type_table_meta.store(meta_addr.as_usize(), Ordering::Relaxed);
GLOBAL_TYPE_TABLE_META.store(meta_addr.as_usize(), Ordering::Relaxed);
// actual table
let table_addr = meta_addr + metadata_size;
global_type_table_ptr.store(table_addr.as_usize(), Ordering::Relaxed);
GLOBAL_TYPE_TABLE_PTR.store(table_addr.as_usize(), Ordering::Relaxed);
// initialize meta
let meta: &mut GlobalTypeTable = unsafe { meta_addr.to_ptr_mut().as_mut().unwrap() };
......@@ -98,12 +98,12 @@ impl GlobalTypeTable {
#[inline(always)]
fn table_meta() -> &'static mut GlobalTypeTable {
unsafe { mem::transmute(global_type_table_meta.load(Ordering::Relaxed)) }
unsafe { mem::transmute(GLOBAL_TYPE_TABLE_META.load(Ordering::Relaxed)) }
}
#[inline(always)]
pub fn table() -> &'static mut [TypeEncode; N_TYPES] {
unsafe { mem::transmute(global_type_table_ptr.load(Ordering::Relaxed)) }
unsafe { mem::transmute(GLOBAL_TYPE_TABLE_PTR.load(Ordering::Relaxed)) }
}
pub fn insert_small_entry(entry: TypeEncode) -> TypeID {
......
......@@ -79,15 +79,8 @@
//! 4 bytes - type ID
//! 4 bytes - unused
use std::sync::atomic;
use common::gctype::GCType;
use heap::SpaceDescriptor;
use heap::immix::*;
use utils::{Address, ObjectReference};
use utils::{LOG_POINTER_SIZE, POINTER_SIZE};
use utils::bit_utils;
use utils::{ByteSize, ByteOffset};
use std::mem::transmute;
use utils::*;
pub const MINIMAL_ALIGNMENT: ByteSize = 16;
pub const MINIMAL_OBJECT_SIZE: ByteSize = 16;
......@@ -107,10 +100,12 @@ pub use objectmodel::sidemap::object_encode::*;
pub use objectmodel::sidemap::type_encode::*;
pub use objectmodel::sidemap::global_type_table::*;
#[allow(unused_variables)]
pub fn gen_gctype_encode(ty: &GCType) -> u64 {
unimplemented!()
}
#[allow(unused_variables)]
pub fn gen_hybrid_gctype_encode(ty: &GCType, length: u32) -> u64 {
unimplemented!()
}
......
......@@ -12,15 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use common::gctype::GCType;
use objectmodel::sidemap::TypeID;
use objectmodel::sidemap::type_encode::WordType;
use std::sync::atomic;
use utils::{Address, ObjectReference};
use utils::{LOG_POINTER_SIZE, POINTER_SIZE};
use utils::bit_utils;
use utils::{ByteSize, ByteOffset};
use utils::*;
use std::mem::transmute;
pub const MAX_TINY_OBJECT: ByteSize = 32;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment