Commit fe2d774e authored by qinsoon's avatar qinsoon

remove warnings

parent 92a7cd8c
......@@ -4,7 +4,6 @@ extern crate doubly;
use utils::Address;
use utils::mem::memmap;
use utils::LOG_POINTER_SIZE;
use common::AddressMap;
use objectmodel;
......@@ -124,7 +123,6 @@ impl FreeListSpace {
let mut treadmill = self.treadmill.lock().unwrap();
{
let trace_map = self.trace_map();
let mark_state = objectmodel::load_mark_state();
let from = treadmill.from;
......
......@@ -9,7 +9,6 @@ use MY_GC;
use utils::{Address, ObjectReference};
use utils::POINTER_SIZE;
use utils::bit_utils;
use std::sync::atomic::{AtomicIsize, Ordering};
use std::sync::{Arc, Mutex, Condvar, RwLock};
......
......@@ -3,8 +3,6 @@ use heap::immix::ImmixSpace;
use heap::immix::immix_space::ImmixBlock;
use heap::gc;
use objectmodel;
use utils::LOG_POINTER_SIZE;
use utils::Address;
use std::*;
......@@ -239,7 +237,7 @@ impl ImmixMutatorLocal {
let new_block : Option<Box<ImmixBlock>> = self.space.get_next_usable_block();
match new_block {
Some(mut b) => {
Some(b) => {
// zero the block - do not need to zero the block here
// we zero lines that get used in try_alloc_from_local()
// b.lazy_zeroing();
......@@ -278,11 +276,13 @@ impl ImmixMutatorLocal {
}
#[cfg(feature = "use-sidemap")]
#[allow(unused_variables)]
fn sanity_check_finished_block(block: &ImmixBlock) {
}
#[cfg(not(feature = "use-sidemap"))]
#[allow(unused_variables)]
fn sanity_check_finished_block(block: &ImmixBlock) {
}
......
use utils::Address;
use utils::bit_utils;
use utils::POINTER_SIZE;
use utils::LOG_POINTER_SIZE;
use std::sync::atomic::AtomicUsize;
use objectmodel;
......@@ -66,8 +64,6 @@ pub trait Space {
return false;
}
let index = (addr.diff(start) >> LOG_POINTER_SIZE) as isize;
// use header
let hdr = unsafe {addr.offset(objectmodel::OBJECT_HEADER_OFFSET).load::<u64>()};
if !objectmodel::header_is_object_start(hdr) {
......
#![allow(dead_code)]
/// * use 1 word (64bits) header
/// * header is before an object reference
......@@ -23,6 +25,7 @@
/// 0
use common::gctype::GCType;
use objectmodel;
use utils::ByteSize;
use utils::ByteOffset;
use utils::bit_utils;
......@@ -87,7 +90,7 @@ pub fn print_object(obj: Address) {
let hdr = unsafe {cursor.offset(OBJECT_HEADER_OFFSET).load::<u64>()};
trace!("- is object start? {}", header_is_object_start(hdr));
trace!("- is traced? {}", header_is_traced(hdr));
trace!("- is traced? {}", header_is_traced(hdr, objectmodel::load_mark_state()));
if header_is_fix_size(hdr) {
trace!("- is fix sized? true");
if header_has_ref_map(hdr) {
......@@ -142,28 +145,28 @@ pub fn mark_as_untraced(addr: Address, mark_state: u8) {
pub fn is_traced(obj: ObjectReference, mark_state: u8) -> bool {
unsafe {
let hdr = obj.to_address().offset(OBJECT_HEADER_OFFSET).load::<u64>();
bit_utils::test_nth_bit_u64(hdr, BIT_IS_TRACED)
bit_utils::test_nth_bit_u64(hdr, BIT_IS_TRACED, mark_state)
}
}
#[inline(always)]
pub fn header_is_object_start(hdr: u64) -> bool {
bit_utils::test_nth_bit_u64(hdr, BIT_IS_OBJ_START)
bit_utils::test_nth_bit_u64(hdr, BIT_IS_OBJ_START, 1u8)
}
#[inline(always)]
pub fn header_is_fix_size(hdr: u64) -> bool {
bit_utils::test_nth_bit_u64(hdr, BIT_IS_FIX_SIZE)
bit_utils::test_nth_bit_u64(hdr, BIT_IS_FIX_SIZE, 1u8)
}
#[inline(always)]
pub fn header_is_traced(hdr: u64) -> bool {
bit_utils::test_nth_bit_u64(hdr, BIT_IS_TRACED)
pub fn header_is_traced(hdr: u64, mark_state: u8) -> bool {
bit_utils::test_nth_bit_u64(hdr, BIT_IS_TRACED, mark_state)
}
#[inline(always)]
pub fn header_has_ref_map(hdr: u64) -> bool {
bit_utils::test_nth_bit_u64(hdr, BIT_HAS_REF_MAP)
bit_utils::test_nth_bit_u64(hdr, BIT_HAS_REF_MAP, 1u8)
}
#[inline(always)]
......@@ -202,7 +205,7 @@ mod tests {
let hdr = hdr_hex;
assert!(header_is_object_start(hdr));
assert!(!header_is_traced(hdr));
assert!(!header_is_traced(hdr, 1u8));
assert!(header_is_fix_size(hdr));
assert!(header_has_ref_map(hdr));
......@@ -223,7 +226,7 @@ mod tests {
let hdr = hdr_hex;
assert!(header_is_object_start(hdr));
assert!(!header_is_traced(hdr));
assert!(!header_is_traced(hdr, 1u8));
assert!(header_is_fix_size(hdr));
assert!(!header_has_ref_map(hdr));
......@@ -244,7 +247,7 @@ mod tests {
let hdr = hdr_hex;
assert!(header_is_object_start(hdr));
assert!(!header_is_traced(hdr));
assert!(!header_is_traced(hdr, 1u8));
assert!(!header_is_fix_size(hdr));
assert_eq!(header_get_hybrid_length(hdr), 128);
......
use std::sync::atomic;
use utils::{Address, ObjectReference};
use utils::{LOG_POINTER_SIZE, POINTER_SIZE};
use utils::bit_utils;
#[cfg(feature = "use-sidemap")]
mod sidemap;
#[cfg(not(feature = "use-sidemap"))]
mod header;
// mark state
......
// u8
#[inline(always)]
pub fn test_nth_bit_u8(value: u8, index: usize) -> bool {
value & (1 << index) != 0
pub fn test_nth_bit_u8(value: u8, index: usize, val: u8) -> bool {
((value >> index) & 1) as u8 == val
}
#[inline(always)]
......@@ -18,8 +18,8 @@ pub fn set_nth_bit_u64 (value: u64, index: usize, set_value: u8) -> u64 {
}
#[inline(always)]
pub fn test_nth_bit_u64(value: u64, index: usize) -> bool {
value & (1 << index) != 0
pub fn test_nth_bit_u64(value: u64, index: usize, val: u8) -> bool {
((value >> index) & 1) as u8 == val
}
#[cfg(test)]
......
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