Reading Gauche/Reading Gauche 0.9/gc/include/private/gc_priv.h/_GC_arrays


Top / Reading Gauche / Reading Gauche 0.9 / gc / include / private / gc_priv.h / _GC_arrays

_GC_arrays

概要

コレクタによってスキャンされるべきでない他のランダムなデータ構造と同様なすべてのヒープブロックリストとフリーリスト。GC_markルーチンを容易にスキップできるように1つの構造体にまとめられている。

/* Lists of all heap blocks and free lists	*/
/* as well as other random data structures	*/
/* that should not be scanned by the		*/
/* collector.					*/
/* These are grouped together in a struct	*/
/* so that they can be easily skipped by the	*/
/* GC_mark routine.				*/
/* The ordering is weird to make GC_malloc	*/
/* faster by keeping the important fields	*/
/* sufficiently close together that a		*/
/* single load of a base register will do.	*/
/* Scalars that could easily appear to		*/
/* be pointers are also put here.		*/
/* The main fields should precede any 		*/
/* conditionally included fields, so that	*/
/* gc_inl.h will work even if a different set	*/
/* of macros is defined when the client is	*/
/* compiled.					*/

struct _GC_arrays {
 word _heapsize;		/* Heap size in bytes.			*/
 word _max_heapsize;
 word _requested_heapsize;	/* Heap size due to explicit expansion */
 ptr_t _last_heap_addr;
 ptr_t _prev_heap_addr;
 word _large_free_bytes;
	/* Total bytes contained in blocks on large object free */
	/* list.						*/
 word _large_allocd_bytes;
 	/* Total number of bytes in allocated large objects blocks.	*/
 	/* For the purposes of this counter and the next one only, a 	*/
 	/* large object is one that occupies a block of at least	*/
 	/* 2*HBLKSIZE.							*/
 word _max_large_allocd_bytes;
 	/* Maximum number of bytes that were ever allocated in		*/
 	/* large object blocks.  This is used to help decide when it	*/
 	/* is safe to split up a large block.				*/
 word _bytes_allocd_before_gc;
		/* Number of words allocated before this	*/
		/* collection cycle.				*/
# ifndef SEPARATE_GLOBALS
   word _bytes_allocd;
 	/* Number of words allocated during this collection cycle */
# endif
 word _bytes_dropped;
 	/* Number of black-listed bytes dropped during GC cycle	*/
	/* as a result of repeated scanning during allocation	*/
	/* attempts.  These are treated largely as allocated,	*/
	/* even though they are not useful to the client.	*/
 word _bytes_finalized;
 	/* Approximate number of bytes in objects (and headers)	*/
 	/* That became ready for finalization in the last 	*/
 	/* collection.						*/
 word _non_gc_bytes_at_gc;
 	/* Number of explicitly managed bytes of storage 	*/
 	/* at last collection.					*/
 word _bytes_freed;
 	/* Number of explicitly deallocated bytes of memory	*/
 	/* since last collection.				*/
 word _finalizer_bytes_freed;
 	/* Bytes of memory explicitly deallocated while 	*/
 	/* finalizers were running.  Used to approximate mem.	*/
 	/* explicitly deallocated by finalizers.		*/
 ptr_t _scratch_end_ptr;
 ptr_t _scratch_last_end_ptr;
	/* Used by headers.c, and can easily appear to point to	*/
	/* heap.						*/
 GC_mark_proc _mark_procs[MAX_MARK_PROCS];
 	/* Table of user-defined mark procedures.  There is	*/
	/* a small number of these, which can be referenced	*/
	/* by DS_PROC mark descriptors.  See gc_mark.h.		*/

# ifndef SEPARATE_GLOBALS
   void *_objfreelist[MAXOBJGRANULES+1];
			  /* free list for objects */
   void *_aobjfreelist[MAXOBJGRANULES+1];
			  /* free list for atomic objs 	*/
# endif

 void *_uobjfreelist[MAXOBJGRANULES+1];
			  /* uncollectable but traced objs 	*/
			  /* objects on this and auobjfreelist  */
			  /* are always marked, except during   */
			  /* garbage collections.		*/
# ifdef ATOMIC_UNCOLLECTABLE
   void *_auobjfreelist[MAXOBJGRANULES+1];
# endif
			  /* uncollectable but traced objs 	*/

   word _composite_in_use;
  		/* Number of words in accessible composite	*/
		/* objects.					*/
   word _atomic_in_use;
  		/* Number of words in accessible atomic		*/
		/* objects.					*/
# ifdef USE_MUNMAP
   word _unmapped_bytes;
# endif

   size_t _size_map[MAXOBJBYTES+1];
   	/* Number of words to allocate for a given allocation request in */
   	/* bytes.							 */

# ifdef STUBBORN_ALLOC
   ptr_t _sobjfreelist[MAXOBJGRANULES+1];
# endif
 			  /* free list for immutable objects	*/
# ifdef MARK_BIT_PER_GRANULE
   short * _obj_map[MAXOBJGRANULES+1];
                      /* If not NIL, then a pointer to a map of valid  */
   		       /* object addresses.				*/
		       /* _obj_map[sz_in_granules][i] is 		*/
 		       /* i % sz_in_granules.				*/
 		       /* This is now used purely to replace a 		*/
 		       /* division in the marker by a table lookup.	*/
   		       /* _obj_map[0] is used for large objects and	*/
   		       /* contains all nonzero entries.  This gets us	*/
   		       /* out of the marker fast path without an extra 	*/
   		       /* test.						*/
#   define MAP_LEN BYTES_TO_GRANULES(HBLKSIZE)
# endif
#   define VALID_OFFSET_SZ HBLKSIZE
 char _valid_offsets[VALID_OFFSET_SZ];
				/* GC_valid_offsets[i] == TRUE ==> i 	*/
				/* is registered as a displacement.	*/
 char _modws_valid_offsets[sizeof(word)];
				/* GC_valid_offsets[i] ==>		  */
				/* GC_modws_valid_offsets[i%sizeof(word)] */
# ifdef STUBBORN_ALLOC
   page_hash_table _changed_pages;
       /* Stubborn object pages that were changes since last call to	*/
	/* GC_read_changed.						*/
   page_hash_table _prev_changed_pages;
       /* Stubborn object pages that were changes before last call to	*/
	/* GC_read_changed.						*/
# endif
# if defined(PROC_VDB) || defined(MPROTECT_VDB) || \
    defined(GWW_VDB) || defined(MANUAL_VDB)
   page_hash_table _grungy_pages; /* Pages that were dirty at last 	   */
				     /* GC_read_dirty.			   */
# endif
# if defined(MPROTECT_VDB) || defined(MANUAL_VDB)
   volatile page_hash_table _dirty_pages;	
			/* Pages dirtied since last GC_read_dirty. */
# endif
# if defined(PROC_VDB) || defined(GWW_VDB)
   page_hash_table _written_pages;	/* Pages ever dirtied	*/
# endif
# ifdef LARGE_CONFIG
#   if CPP_WORDSZ > 32
#     define MAX_HEAP_SECTS 4096 	/* overflows at roughly 64 GB	   */
#   else
#     define MAX_HEAP_SECTS 768		/* Separately added heap sections.   */
#   endif
# else
#   ifdef SMALL_CONFIG
#     define MAX_HEAP_SECTS 128		/* Roughly 256MB (128*2048*1K)	*/
#   else
#     define MAX_HEAP_SECTS 384		/* Roughly 3GB			*/
#   endif
# endif
 struct HeapSect {
     ptr_t hs_start; size_t hs_bytes;
 } _heap_sects[MAX_HEAP_SECTS];	/* Heap segments potentially 	*/
 					/* client objects.		*/
# if defined(USE_PROC_FOR_LIBRARIES)
    struct HeapSect _our_memory[MAX_HEAP_SECTS];
    					/* All GET_MEM allocated	*/
					/* memory.  Includes block 	*/
					/* headers and the like.	*/
# endif
# if defined(MSWIN32) || defined(MSWINCE)
   ptr_t _heap_bases[MAX_HEAP_SECTS];
   		/* Start address of memory regions obtained from kernel. */
# endif
# ifdef MSWINCE
   word _heap_lengths[MAX_HEAP_SECTS];
   		/* Commited lengths of memory regions obtained from kernel. */
# endif
 struct roots _static_roots[MAX_ROOT_SETS];
# if !defined(MSWIN32) && !defined(MSWINCE)
   struct roots * _root_index[RT_SIZE];
# endif
 struct exclusion _excl_table[MAX_EXCLUSIONS];
 /* Block header index; see gc_headers.h */
 bottom_index * _all_nils;
 bottom_index * _top_index [TOP_SZ];
#ifdef ENABLE_TRACE
 ptr_t _trace_addr;
#endif
#ifdef SAVE_CALL_CHAIN
 struct callinfo _last_stack[NFRAMES];	/* Stack at last garbage collection.*/
 					/* Useful for debugging	mysterious  */
 					/* object disappearances.	    */
 					/* In the multithreaded case, we    */
 					/* currently only save the calling  */
 					/* stack.			    */
#endif
};

調べるもの

参照元

コメント

コメントはありません。 コメント/Reading Gauche/Reading Gauche 0.9/gc/include/private/gc_priv.h/_GC_arrays?

お名前:

MENU

now: 8

リンク


最新の20件
2020-05-22 2020-05-14 2020-05-12 2020-05-10 2020-04-27 2020-03-23
最新の20件
2010-02-01 2010-01-31 2010-01-30 2010-01-29 2010-01-16

Counter: 1463, today: 1, yesterday: 1

リロード   新規 編集 凍結 差分 添付 複製 改名   トップ 一覧 検索 最終更新 バックアップ   ヘルプ   最終更新のRSS

Last-modified: 2010-01-04 (月) 19:23:19 (3794d);  Modified by mona
PukiWiki 1.4.6 Copyright © 2001-2005 PukiWiki Developers Team. License is GPL.
Based on "PukiWiki" 1.3 by yu-ji
Powered by PHP 5.2.17
HTML convert time to 0.037 sec.