harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yuri Kashnikoff" <yuri.kashnik...@gmail.com>
Subject [drlvm][gc] How to iterate MOS?
Date Tue, 29 Jan 2008 07:20:45 GMT
I am trying to iterate MOS (see below). And on DaCapo::jython I've got
problems with this code,(vm_object_size crashes). Any
ideas/suggestions ?

        Blocked_Space *mspace = (Blocked_Space*)gc->mos;
        Block_Header *curr_block = (Block_Header*)mspace->blocks;
        Block_Header *space_end =
(Block_Header*)&mspace->blocks[mspace->free_block_idx -
mspace->first_block_idx];
        while(curr_block < space_end) {
            POINTER_SIZE_INT p_obj = (POINTER_SIZE_INT)curr_block->base;
            POINTER_SIZE_INT p_next_obj = p_obj;
            POINTER_SIZE_INT block_end = (POINTER_SIZE_INT)curr_block->free;

            unsigned int hash_extend_size = 0;
            while(p_obj < block_end){
#ifdef USE_32BITS_HASHCODE
                hash_extend_size  =
(hashcode_is_attached((Partial_Reveal_Object*)p_obj))?GC_OBJECT_ALIGNMENT:0;
#endif
                 p_next_obj = p_obj +
vm_object_size((Partial_Reveal_Object *)p_obj);// + hash_extend_size;
                 //do something with p_obj
                 p_obj = p_next_obj;
            }
            curr_block = curr_block->next;
            if(curr_block == NULL) break;
        }
    }


-- 
Yuri S. Kashnikov
Novosibirsk State University, Russia
2 Pirogova street
630090, Novosibirsk-90
yuri.kashnikoff@gmail.com

Mime
View raw message