概要
リテラルテーブルの定義
メンバー
- LiteralEntry **buckets; buckets配列へのポインタ
- LiteralEntry *staticBuckets[TCL_SMALL_HASH_TABLE]; mallocとfreeを避けるための小さな配列に使うBuckets
- int numBuckets;
- int numEntries;
- int rebuildSize;
- int mask;
ソース
/*
* The definitions for the LiteralTable and LiteralEntry structures. Each
* interpreter contains a LiteralTable. It is used to reduce the storage
* needed for all the Tcl objects that hold the literals of scripts compiled
* by the interpreter. A literal's object is shared by all the ByteCodes that
* refer to the literal. Each distinct literal has one LiteralEntry entry in
* the LiteralTable. A literal table is a specialized hash table that is
* indexed by the literal's string representation, which may contain null
* characters.
*
* Note that we reduce the space needed for literals by sharing literal
* objects both within a ByteCode (each ByteCode contains a local
* LiteralTable) and across all an interpreter's ByteCodes (with the
* interpreter's global LiteralTable).
*/
typedef struct LiteralTable {
[[LiteralEntry]] **buckets; /* Pointer to bucket array. Each element
* points to first entry in bucket's hash
* chain, or NULL. */
LiteralEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
/* Bucket array used for small tables to avoid
* mallocs and frees. */
int numBuckets; /* Total number of buckets allocated at
* **buckets. */
int numEntries; /* Total number of entries present in
* table. */
int rebuildSize; /* Enlarge table when numEntries gets to be
* this large. */
int mask; /* Mask value used in hashing function. */
} LiteralTable;
最終更新:2011年11月04日 15:39