TeX in C
Explore TeX with modern c compiler.
PART 11: Memory layout

宏定义

#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. 更多...
 

函数

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] 更多...
 

变量

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? 更多...
 

详细描述

宏定义说明

◆ active

[#162] head of active list in line break, needs two words.

◆ adjusthead

#define adjusthead   (holdhead-CHAR_NODE_SIZE)

[#162] head of adjustment list returned by hpack.

◆ alignhead

#define alignhead   (active-CHAR_NODE_SIZE)

[#162] head of preamble list for alignments.

◆ backuphead

#define backuphead   (ligtrick-CHAR_NODE_SIZE)

[#162] head of token list built by scan_keyword.

◆ contribhead

#define contribhead   (pageinshead-CHAR_NODE_SIZE)

[#162] vlist of items not yet on current page.

◆ endspan

#define endspan   (alignhead-CHAR_NODE_SIZE)

[#162] tail of spanned-width lists.

◆ filglue

#define filglue   (zeroglue + gluespecsize)

[#162] 0pt plus 1fil minus 0pt.

◆ fillglue

#define fillglue   (filglue + gluespecsize)

[#162] 0pt plus 1fill minus 0pt.

◆ filnegglue

#define filnegglue   (ssglue + gluespecsize)

[#162] 0pt plus −1fil minus 0pt.

◆ garbage

#define garbage   (ligtrick)

[#162] used for scrap information.

◆ himemstatmin

#define himemstatmin   (backuphead)

[#162] smallest statically allocated word in the one-word mem.

◆ himemstatusage

#define himemstatusage   14

[#162] the number of one-word nodes always present.

[ori:14] TODO: check 14*CHAR_NODE_SIZE

◆ holdhead

#define holdhead   (temphead-CHAR_NODE_SIZE)

[#162] head of a temporary list of another kind.

◆ ligtrick

#define ligtrick   (nulllist-CHAR_NODE_SIZE)

[#162] a ligature masquerading as a char_node.

◆ lomemstatmax

#define lomemstatmax   (filnegglue + gluespecsize - 1)

[#162] largest statically allocated word in the variable-size mem.

◆ nulllist

[#162] permanently empty list.

◆ omittemplate

#define omittemplate   (endspan-CHAR_NODE_SIZE)

[#162] a constant token list.

◆ pagehead

#define pagehead   (contribhead-CHAR_NODE_SIZE)

[#162] vlist for current page.

◆ pageinshead

#define pageinshead   (MEM_TOP-CHAR_NODE_SIZE+1)

[#162] list of insertion data for current page.

◆ ssglue

#define ssglue   (fillglue + gluespecsize)

[#162] 0pt plus 1fil minus 1fil.

◆ temphead

#define temphead   (pagehead-CHAR_NODE_SIZE)

[#162] head of a temporary list of some kind.

◆ zeroglue

#define zeroglue   MEM_BOT

[#162] specification for 0pt plus 0pt minus 0pt.

函数说明

◆ check_mem()

void check_mem ( Boolean  printlocs)

p60#167

[#168] Check single-word avail list

[#169] Check variable-size avail list

[#170] Check flags of unavailable nodes

[#171] Print newly busy locations

◆ mem_init_once()

void mem_init_once ( )

[#164]

#790

#797

#820

p59#164

◆ mem_var_init()

void mem_var_init ( )

[p59#166]

indicate that everything was previously free.

◆ search_mem()

void search_mem ( Pointer  p)

p61#172

[#255] Search eqtb for equivalents equal to p

[#285] Search save stack for equivalents that point to p

[#933] Search hyph list for pointers to p

变量说明

◆ free_cells

UChar free_cells[(MEM_MAX - MEM_MIN+8)/8]

[#165] free: free cells, 以 byte(8) 分配,按位取用.

◆ panicking

Boolean panicking

[#165] do we want to check memory constantly?

◆ was_free

UChar was_free[(MEM_MAX - MEM_MIN+8)/8]

[#165] previously free cells, 以 byte(8) 分配,按位取用.

◆ was_hi_min

Pointer was_hi_min

◆ was_lo_max

Pointer was_lo_max

◆ was_mem_end

Pointer was_mem_end

[#165] previous mem_end, lo_mem_max, and hi_mem_min.