现在的位置: 首页 > 综合 > 正文

VM之GC篇(gc.h)

2018年01月21日 ⁄ 综合 ⁄ 共 922字 ⁄ 字号 评论关闭

从gc.h里面可以发现以下定义:

1.Turn on profiling(以后具体补充其作用)

#ifdef PROFILING_SUPPORTED
#define GC_PROFILING       //Turn on profiling
#endif // PROFILING_SUPPORTED

 

2.Function Prototypes

/*
 * Promotion Function Prototypes
 */
typedef void enum_func (Object*);

// callback functions for heap walkers
typedef void object_callback_func(void * pvContext, void * pvDataLoc);

 

// stub type to abstract a heap segment
struct gc_heap_segment_stub;
typedef gc_heap_segment_stub *segment_handle;

 

3.segment_info

struct segment_info
{
    LPVOID pvMem; // base of the allocation, not the first object (must add ibFirstObject)
    size_t ibFirstObject;   // offset to the base of the first object in the segment
    size_t ibAllocated; // limit of allocated memory in the segment (>= firstobject)
    size_t ibCommit; // limit of committed memory in the segment (>= alllocated)
    size_t ibReserved; // limit of reserved memory in the segment (>= commit)
};

/* forward declerations */
class CObjectHeader;
class Object;

4.大对象

/* misc defines */
#define LARGE_OBJECT_SIZE   85000

 

5.

 

 

 

 

 

抱歉!评论已关闭.