gc_block.h File Reference


Classes

struct  Block_Header
union  Block

Defines

#define GC_BLOCK_SHIFT_COUNT   15
 
Author:
Xiao-Feng Li, 2006/10/05

#define GC_BLOCK_SIZE_BYTES   (1 << GC_BLOCK_SHIFT_COUNT)
#define GC_BLOCK_HEADER_VARS_SIZE_BYTES   (POINTER_SIZE_INT)&(((Block_Header*)0)->table)
#define SECTOR_SIZE_SHIFT_COUNT   8
#define SECTOR_SIZE_BYTES   (1 << SECTOR_SIZE_SHIFT_COUNT)
#define SECTOR_SIZE_WORDS   (SECTOR_SIZE_BYTES >> BIT_SHIFT_TO_BYTES_PER_WORD)
#define OFFSET_TABLE_COMPUTE_DIVISOR   (SECTOR_SIZE_WORDS + 1)
#define OFFSET_TABLE_COMPUTED_SIZE_BYTE   ((GC_BLOCK_SIZE_BYTES-GC_BLOCK_HEADER_VARS_SIZE_BYTES)/OFFSET_TABLE_COMPUTE_DIVISOR + 1)
#define OFFSET_TABLE_SIZE_BYTES   ((OFFSET_TABLE_COMPUTED_SIZE_BYTE + MASK_OF_BYTES_PER_WORD)&~MASK_OF_BYTES_PER_WORD)
#define OFFSET_TABLE_SIZE_WORDS   (OFFSET_TABLE_SIZE_BYTES >> BIT_SHIFT_TO_BYTES_PER_WORD)
#define OBJECT_INDEX_TO_OFFSET_TABLE(p_obj)   (ADDRESS_OFFSET_IN_BLOCK_BODY(p_obj) >> SECTOR_SIZE_SHIFT_COUNT)
#define GC_BLOCK_HEADER_SIZE_BYTES   ((OFFSET_TABLE_SIZE_BYTES + GC_BLOCK_HEADER_VARS_SIZE_BYTES + GC_OBJECT_ALIGN_MASK ) & (~GC_OBJECT_ALIGN_MASK))
#define GC_BLOCK_BODY_SIZE_BYTES   (GC_BLOCK_SIZE_BYTES - GC_BLOCK_HEADER_SIZE_BYTES)
#define GC_BLOCK_BODY(block)   ((void*)((POINTER_SIZE_INT)(block) + GC_BLOCK_HEADER_SIZE_BYTES))
#define GC_BLOCK_END(block)   (((Block_Header*)(block))->ceiling)
#define GC_BLOCK_LOW_MASK   ((POINTER_SIZE_INT)(GC_BLOCK_SIZE_BYTES - 1))
#define GC_BLOCK_HIGH_MASK   (~GC_BLOCK_LOW_MASK)
#define GC_BLOCK_HEADER(addr)   ((Block_Header *)((POINTER_SIZE_INT)(addr) & GC_BLOCK_HIGH_MASK))
#define GC_BLOCK_INDEX(addr)   ((unsigned int)(GC_BLOCK_HEADER(addr)->block_idx))
#define GC_BLOCK_INDEX_FROM(heap_start, addr)   ((unsigned int)(((POINTER_SIZE_INT)(addr)-(POINTER_SIZE_INT)(heap_start)) >> GC_BLOCK_SHIFT_COUNT))
#define ADDRESS_OFFSET_TO_BLOCK_HEADER(addr)   ((unsigned int)((POINTER_SIZE_INT)addr&GC_BLOCK_LOW_MASK))
#define ADDRESS_OFFSET_IN_BLOCK_BODY(addr)   ((unsigned int)(ADDRESS_OFFSET_TO_BLOCK_HEADER(addr)- GC_BLOCK_HEADER_SIZE_BYTES))

Enumerations

enum  Block_Status {
  BLOCK_NIL = 0, BLOCK_FREE = 0x1, BLOCK_IN_USE = 0x2, BLOCK_USED = 0x4,
  BLOCK_IN_COMPACT = 0x8, BLOCK_COMPACTED = 0x10, BLOCK_TARGET = 0x20, BLOCK_DEST = 0x40
}

Functions

void block_init (Block_Header *block)
void block_reset (Block_Header *block)
void block_destruct (Block_Header *block)
Partial_Reveal_Objectobj_end (Partial_Reveal_Object *obj)
void obj_set_prefetched_next_pointer (Partial_Reveal_Object *p_obj, Partial_Reveal_Object *raw_prefetched_next)
Partial_Reveal_Objectobj_get_prefetched_next_pointer (Partial_Reveal_Object *p_obj)
Partial_Reveal_Objectnext_marked_obj_in_block (Partial_Reveal_Object *cur_obj, Partial_Reveal_Object *block_end)
Partial_Reveal_Objectobj_get_fw_in_table (Partial_Reveal_Object *p_obj)
void block_clear_table (Block_Header *block)
Partial_Reveal_Objectblock_get_first_marked_object (Block_Header *block, void **start_pos)
Partial_Reveal_Objectblock_get_next_marked_object (Block_Header *block, void **start_pos)
Partial_Reveal_Objectblock_get_first_marked_obj_prefetch_next (Block_Header *block, void **start_pos)
Partial_Reveal_Objectblock_get_first_marked_obj_after_prefetch (Block_Header *block, void **start_pos)
Partial_Reveal_Objectblock_get_next_marked_obj_prefetch_next (Block_Header *block, void **start_pos)
Partial_Reveal_Objectblock_get_next_marked_obj_after_prefetch (Block_Header *block, void **start_pos)


Define Documentation

#define GC_BLOCK_SHIFT_COUNT   15

Author:
Xiao-Feng Li, 2006/10/05

#define GC_BLOCK_SIZE_BYTES   (1 << GC_BLOCK_SHIFT_COUNT)

#define GC_BLOCK_HEADER_VARS_SIZE_BYTES   (POINTER_SIZE_INT)&(((Block_Header*)0)->table)

#define SECTOR_SIZE_SHIFT_COUNT   8

#define SECTOR_SIZE_BYTES   (1 << SECTOR_SIZE_SHIFT_COUNT)

#define SECTOR_SIZE_WORDS   (SECTOR_SIZE_BYTES >> BIT_SHIFT_TO_BYTES_PER_WORD)

#define OFFSET_TABLE_COMPUTE_DIVISOR   (SECTOR_SIZE_WORDS + 1)

#define OFFSET_TABLE_COMPUTED_SIZE_BYTE   ((GC_BLOCK_SIZE_BYTES-GC_BLOCK_HEADER_VARS_SIZE_BYTES)/OFFSET_TABLE_COMPUTE_DIVISOR + 1)

#define OFFSET_TABLE_SIZE_BYTES   ((OFFSET_TABLE_COMPUTED_SIZE_BYTE + MASK_OF_BYTES_PER_WORD)&~MASK_OF_BYTES_PER_WORD)

#define OFFSET_TABLE_SIZE_WORDS   (OFFSET_TABLE_SIZE_BYTES >> BIT_SHIFT_TO_BYTES_PER_WORD)

#define OBJECT_INDEX_TO_OFFSET_TABLE ( p_obj   )     (ADDRESS_OFFSET_IN_BLOCK_BODY(p_obj) >> SECTOR_SIZE_SHIFT_COUNT)

#define GC_BLOCK_HEADER_SIZE_BYTES   ((OFFSET_TABLE_SIZE_BYTES + GC_BLOCK_HEADER_VARS_SIZE_BYTES + GC_OBJECT_ALIGN_MASK ) & (~GC_OBJECT_ALIGN_MASK))

#define GC_BLOCK_BODY_SIZE_BYTES   (GC_BLOCK_SIZE_BYTES - GC_BLOCK_HEADER_SIZE_BYTES)

#define GC_BLOCK_BODY ( block   )     ((void*)((POINTER_SIZE_INT)(block) + GC_BLOCK_HEADER_SIZE_BYTES))

#define GC_BLOCK_END ( block   )     (((Block_Header*)(block))->ceiling)

#define GC_BLOCK_LOW_MASK   ((POINTER_SIZE_INT)(GC_BLOCK_SIZE_BYTES - 1))

#define GC_BLOCK_HIGH_MASK   (~GC_BLOCK_LOW_MASK)

#define GC_BLOCK_HEADER ( addr   )     ((Block_Header *)((POINTER_SIZE_INT)(addr) & GC_BLOCK_HIGH_MASK))

#define GC_BLOCK_INDEX ( addr   )     ((unsigned int)(GC_BLOCK_HEADER(addr)->block_idx))

#define GC_BLOCK_INDEX_FROM ( heap_start,
addr   )     ((unsigned int)(((POINTER_SIZE_INT)(addr)-(POINTER_SIZE_INT)(heap_start)) >> GC_BLOCK_SHIFT_COUNT))

#define ADDRESS_OFFSET_TO_BLOCK_HEADER ( addr   )     ((unsigned int)((POINTER_SIZE_INT)addr&GC_BLOCK_LOW_MASK))

#define ADDRESS_OFFSET_IN_BLOCK_BODY ( addr   )     ((unsigned int)(ADDRESS_OFFSET_TO_BLOCK_HEADER(addr)- GC_BLOCK_HEADER_SIZE_BYTES))


Enumeration Type Documentation

enum Block_Status

Enumerator:
BLOCK_NIL 
BLOCK_FREE 
BLOCK_IN_USE 
BLOCK_USED 
BLOCK_IN_COMPACT 
BLOCK_COMPACTED 
BLOCK_TARGET 
BLOCK_DEST 


Function Documentation

void block_init ( Block_Header block  ) 

void block_reset ( Block_Header block  ) 

void block_destruct ( Block_Header block  ) 

Partial_Reveal_Object* obj_end ( Partial_Reveal_Object obj  ) 

void obj_set_prefetched_next_pointer ( Partial_Reveal_Object p_obj,
Partial_Reveal_Object raw_prefetched_next 
)

Partial_Reveal_Object* obj_get_prefetched_next_pointer ( Partial_Reveal_Object p_obj  ) 

Partial_Reveal_Object* next_marked_obj_in_block ( Partial_Reveal_Object cur_obj,
Partial_Reveal_Object block_end 
)

Partial_Reveal_Object* obj_get_fw_in_table ( Partial_Reveal_Object p_obj  ) 

void block_clear_table ( Block_Header block  ) 

Partial_Reveal_Object* block_get_first_marked_object ( Block_Header block,
void **  start_pos 
)

Partial_Reveal_Object* block_get_next_marked_object ( Block_Header block,
void **  start_pos 
)

Partial_Reveal_Object* block_get_first_marked_obj_prefetch_next ( Block_Header block,
void **  start_pos 
)

Partial_Reveal_Object* block_get_first_marked_obj_after_prefetch ( Block_Header block,
void **  start_pos 
)

Partial_Reveal_Object* block_get_next_marked_obj_prefetch_next ( Block_Header block,
void **  start_pos 
)

Partial_Reveal_Object* block_get_next_marked_obj_after_prefetch ( Block_Header block,
void **  start_pos 
)


Genereated on Tue Mar 11 19:25:34 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.