TeX in C
Explore TeX with modern c compiler.
|
null=0 ≤ MEM_MIN=0 ≤ MEM_BOT=0 < lo_mem_max < hi_mem_min < MEM_TOP=3_000_000 ≤ mem_end ≤ MEM_MAX=3_000_000 . 更多...
宏定义 | |
#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. 更多... | |
函数 | |
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 更多... | |
变量 | |
Pointer | temp_ptr |
[#115] for occasional emergency use. 更多... | |
MemoryWord | mem [MEM_MAX - MEM_MIN+1] |
[#116] the big dynamic storage area. 更多... | |
Pointer | lo_mem_max |
[#116] the largest location of variable-size memory. 更多... | |
Pointer | hi_mem_min |
[#116] the smallest location of one-word memory. 更多... | |
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 | mem_end |
[#118] the last one-word node used in mem. 更多... | |
Pointer | rover |
[#124] points to some node in the list of empties. 更多... | |
null=0 ≤ MEM_MIN=0 ≤ MEM_BOT=0 < lo_mem_max < hi_mem_min < MEM_TOP=3_000_000 ≤ mem_end ≤ MEM_MAX=3_000_000 .
#define empty_flag MAX_HALF_WORD |
[p46#124] the link
of an empty variable-size node.
#define FAST_GET_AVAIL | ( | x | ) |
[#122] avoid get_avail() if possible, to save time.
[p45#121] single-word node liberation.
a one-word node is recycled by calling FREE_AVAIL.
#define is_empty | ( | x | ) | (link(x) == empty_flag) |
[p46#124] tests for empty node.
void flush_list | ( | HalfWord | p | ) |
[p46#123]: makes list of single-word nodes available
Pointer get_avail | ( | void | ) |
[p45#120]: single-word node allocation.
Pointer get_lo_mem_max | ( | void | ) |
[p47#125] variable-size node allocation
[#127] Try to allocate within node p and its physical successors, and goto found if allocation was possible.
[#126] Grow more variable-size memory and goto restart
void sort_avail | ( | void | ) |
p49#131: sorts the available variable-size nodes by location used at #1311
#132: Sort p into the list starting at rover and ADVANCE p to rlink(p)
Pointer avail |
[#118] head of the list of available one-word nodes.
Integer dyn_used |
[#117] how much memory is in use.
Pointer hi_mem_min |
[#116] the smallest location of one-word memory.
Pointer lo_mem_max |
[#116] the largest location of variable-size memory.
MemoryWord mem[MEM_MAX - MEM_MIN+1] |
[#116] the big dynamic storage area.
Pointer mem_end |
[#118] the last one-word node used in mem.
Pointer rover |
[#124] points to some node in the list of empties.
Pointer temp_ptr |
[#115] for occasional emergency use.
Integer var_used |