TeX in C
Explore TeX with modern c compiler.
mem.h 文件参考
#include "global.h"
#include "tex_constant.h"
mem.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

宏定义

#define null   0
 [p44#115] the null pointer. 更多...
 
#define link(x)   (mem[(x)].hh.rh)
 [p45#118] the link field of a memory word. 更多...
 
#define info(x)   (mem[(x)].hh.UU.lh)
 [p45#118] the info field of a memory word. 更多...
 
#define empty_flag   MAX_HALF_WORD
 [p46#124] the link of an empty variable-size node. 更多...
 
#define is_empty(x)   (link(x) == empty_flag)
 [p46#124] tests for empty node. 更多...
 
#define node_size   info
 [p46#124] the size field in empty variable-size nodes. 更多...
 
#define llink(x)   info(x+1)
 [p46#124] left link in doubly-linked list of empty nodes. 更多...
 
#define rlink(x)   link(x+1)
 [p46#124] right link in doubly-linked list of empty nodes. 更多...
 
#define FREE_AVAIL(x)   (link(x) = avail, avail = (x), dyn_used -= CHAR_NODE_SIZE)
 [p45#121] single-word node liberation. 更多...
 
#define FAST_GET_AVAIL(x)
 [#122] avoid get_avail() if possible, to save time. 更多...
 
#define P_clrbits_B(trie, idx, z, w)   trie[(idx) >> 3] &= ~(1 << ((idx)&7))
 
#define P_getbits_UB(trie, h, z, w)   (trie[(h) >> 3] & (1 << ((h)&7)))
 
#define P_putbits_UB(trie, h, y, z, w)   trie[(h) >> 3] |= 1 << ((h)&7)
 
#define zeroglue   MEM_BOT
 [#162] specification for 0pt plus 0pt minus 0pt. 更多...
 
#define filglue   (zeroglue + gluespecsize)
 [#162] 0pt plus 1fil minus 0pt. 更多...
 
#define fillglue   (filglue + gluespecsize)
 [#162] 0pt plus 1fill minus 0pt. 更多...
 
#define ssglue   (fillglue + gluespecsize)
 [#162] 0pt plus 1fil minus 1fil. 更多...
 
#define filnegglue   (ssglue + gluespecsize)
 [#162] 0pt plus −1fil minus 0pt. 更多...
 
#define lomemstatmax   (filnegglue + gluespecsize - 1)
 [#162] largest statically allocated word in the variable-size mem. 更多...
 
#define pageinshead   (MEM_TOP-CHAR_NODE_SIZE+1)
 [#162] list of insertion data for current page. 更多...
 
#define contribhead   (pageinshead-CHAR_NODE_SIZE)
 [#162] vlist of items not yet on current page. 更多...
 
#define pagehead   (contribhead-CHAR_NODE_SIZE)
 [#162] vlist for current page. 更多...
 
#define temphead   (pagehead-CHAR_NODE_SIZE)
 [#162] head of a temporary list of some kind. 更多...
 
#define holdhead   (temphead-CHAR_NODE_SIZE)
 [#162] head of a temporary list of another kind. 更多...
 
#define adjusthead   (holdhead-CHAR_NODE_SIZE)
 [#162] head of adjustment list returned by hpack. 更多...
 
#define active   (adjusthead-CHAR_NODE_SIZE-CHAR_NODE_SIZE)
 [#162] head of active list in line break, needs two words. 更多...
 
#define alignhead   (active-CHAR_NODE_SIZE)
 [#162] head of preamble list for alignments. 更多...
 
#define endspan   (alignhead-CHAR_NODE_SIZE)
 [#162] tail of spanned-width lists. 更多...
 
#define omittemplate   (endspan-CHAR_NODE_SIZE)
 [#162] a constant token list. 更多...
 
#define nulllist   (omittemplate-CHAR_NODE_SIZE)
 [#162] permanently empty list. 更多...
 
#define ligtrick   (nulllist-CHAR_NODE_SIZE)
 [#162] a ligature masquerading as a char_node. 更多...
 
#define garbage   (ligtrick)
 [#162] used for scrap information. 更多...
 
#define backuphead   (ligtrick-CHAR_NODE_SIZE)
 [#162] head of token list built by scan_keyword. 更多...
 
#define himemstatmin   (backuphead)
 [#162] smallest statically allocated word in the one-word mem. 更多...
 
#define himemstatusage   14
 [#162] the number of one-word nodes always present. 更多...
 

函数

Pointer get_lo_mem_max (void)
 
Pointer get_avail (void)
 [p45#120]: single-word node allocation. 更多...
 
void flush_list (HalfWord p)
 [p46#123]: makes list of single-word nodes available 更多...
 
HalfWord get_node (Integer s)
 [p47#125] variable-size node allocation 更多...
 
void free_node (Pointer p, HalfWord s)
 [p48#130]: variable-size node liberation 更多...
 
void sort_avail (void)
 p49#131: sorts the available variable-size nodes by location used at #1311 更多...
 
void check_mem (Boolean printlocs)
 p60#167 更多...
 
void search_mem (Pointer p)
 p61#172 更多...
 
void mem_init_once ()
 [#164] 更多...
 
void mem_var_init ()
 [p59#166] 更多...
 

变量

Pointer temp_ptr
 [#115] for occasional emergency use. 更多...
 
Integer var_used
 
Integer dyn_used
 [#117] how much memory is in use. 更多...
 
Pointer avail
 [#118] head of the list of available one-word nodes. 更多...
 
Pointer rover
 [#124] points to some node in the list of empties. 更多...
 
Pointer lo_mem_max
 [#116] the largest location of variable-size memory. 更多...
 
Pointer hi_mem_min
 [#116] the smallest location of one-word memory. 更多...
 
Pointer mem_end
 [#118] the last one-word node used in mem. 更多...
 
MemoryWord mem [MEM_MAX - MEM_MIN+1]
 [#116] the big dynamic storage area. 更多...
 
UChar free_cells [(MEM_MAX - MEM_MIN+8)/8]
 [#165] free: free cells, 以 byte(8) 分配,按位取用. 更多...
 
UChar was_free [(MEM_MAX - MEM_MIN+8)/8]
 [#165] previously free cells, 以 byte(8) 分配,按位取用. 更多...
 
Pointer was_mem_end
 [#165] previous mem_end, lo_mem_max, and hi_mem_min. 更多...
 
Pointer was_lo_max
 
Pointer was_hi_min
 
Boolean panicking
 [#165] do we want to check memory constantly? 更多...
 

宏定义说明

◆ P_clrbits_B

#define P_clrbits_B (   trie,
  idx,
  z,
 
)    trie[(idx) >> 3] &= ~(1 << ((idx)&7))

◆ P_getbits_UB

#define P_getbits_UB (   trie,
  h,
  z,
 
)    (trie[(h) >> 3] & (1 << ((h)&7)))

◆ P_putbits_UB

#define P_putbits_UB (   trie,
  h,
  y,
  z,
 
)    trie[(h) >> 3] |= 1 << ((h)&7)

变量说明

◆ was_hi_min

Pointer was_hi_min

◆ was_lo_max

Pointer was_lo_max