summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx65
1 files changed, 33 insertions, 32 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
index 9a6b87ce213..cd79e4469d9 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
@@ -35,7 +35,7 @@
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3alloc.dtx 4712 2014-04-30 08:17:49Z joseph $
+\GetIdInfo$Id: l3alloc.dtx 5363 2014-08-24 19:57:56Z joseph $
{L3 Register allocation}
\begin{document}
\DocInput{\jobname.dtx}
@@ -68,22 +68,23 @@
% format. Under \LaTeX{}, the \pkg{etex} package is used for allocation
% management.
%
-% This module provides the basic mechanism for allocating \TeX{}s
+% This module provides the basic mechanism for allocating \TeX{}'s
% registers. While designing this we have to take into account the
% following characteristics:
% \begin{itemize}
% \item |\box255| is reserved for use in the output routine, so it
% should not be allocated otherwise.
-% \item \TeX{} can load up 256 hyphenation patterns (registers
-% \tn{language} 0--255),
-% \item \TeX{} can load no more than 16 math families,
-% \item \TeX{} supports no more than 16 I/O streams for reading
-% (\tn{read}) and 16 I/O streams for writing (\tn{write}),
-% \item \TeX{} supports no more than 256 inserts.
+% \item \TeX{} can load up $256$ hyphenation patterns (registers
+% \tn{language} $0$ to $255$),
+% \item \TeX{} can load no more than $16$ math families,
+% \item \TeX{} supports no more than $16$ I/O streams for reading
+% (\tn{read}) and $16$ I/O streams for writing (\tn{write}),
+% \item \TeX{} supports no more than $256$ inserts.
% \item The other registers (\tn{count}, \tn{dimen}, \tn{skip},
-% \tn{muskip}, \tn{box}, and \tn{toks}) range from 0 to 32767
-% (65535 for \LuaTeX{}), but registers numbered above 255 are
-% accessed somewhat less efficiently.
+% \tn{muskip}, \tn{box}, and \tn{toks}) range from $0$ to $32\,767$
+% ($65\,535$ for \LuaTeX{}), but registers numbered above $255$ are
+% accessed somewhat less efficiently (except in \LuaTeX{}, where access
+% is \enquote[flat}).
% \item Registers could be allocated both globally and locally; the
% use of registers could also be global or local. Here we
% provide support for globally allocated registers for both
@@ -143,7 +144,8 @@
% \end{macrocode}
%
% \begin{macro}[int]{\@@_new:nnnN}
-% Shorthand for defining new register types and their allocators:
+% Shorthand for defining new register types and their allocators: creates
+% the appropriate variables and the allocator function itself.
% \begin{macrocode}
\cs_new_protected:Npn \@@_new:nnnN #1#2#3#4
{
@@ -160,8 +162,8 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_setup_type:nnn #1#2#3
{
- \tl_new:c { g__ #1 _allocation_tl }
- \tl_set:cx { g__ #1 _allocation_tl } { \int_eval:n {#2} }
+ \tl_new:c { g__ #1 _allocation_tl }
+ \tl_gset:cx { g__ #1 _allocation_tl } { \int_eval:n {#2} }
\tl_const:cx { c__ #1 _allocation_max_tl } { \int_eval:n {#3} }
}
% \end{macrocode}
@@ -185,10 +187,10 @@
\luatex_if_engine:TF
{ \@@_new:nnnN { box } \c_zero \c_max_register_int \tex_chardef:D }
{ \@@_new:nnnN { box } \c_zero \c_max_register_int \tex_mathchardef:D }
-\@@_new:nnnN { dim } \c_zero \c_max_register_int \tex_dimendef:D
-\@@_new:nnnN { int } { 11 } \c_max_register_int \tex_countdef:D
-\@@_new:nnnN { muskip } \c_zero \c_max_register_int \tex_muskipdef:D
-\@@_new:nnnN { skip } \c_zero \c_max_register_int \tex_skipdef:D
+\@@_new:nnnN { dim } \c_zero \c_max_register_int \tex_dimendef:D
+\@@_new:nnnN { int } { 11 } \c_max_register_int \tex_countdef:D
+\@@_new:nnnN { muskip } \c_zero \c_max_register_int \tex_muskipdef:D
+\@@_new:nnnN { skip } \c_zero \c_max_register_int \tex_skipdef:D
% \end{macrocode}
% \end{macro}
%
@@ -198,22 +200,21 @@
% \begin{macrocode}
\@@_new:nnnN { insert } { 221 } { 254 } \tex_chardef:D
% \end{macrocode}
-% Reserve a gap in the \texttt{dim}, \texttt{int} and \texttt{skip} lists.
-% (An inline token list mapping would read better here, but this does not
-% work until \texttt{int} allocation is available!)
+% Reserve a gap in the \texttt{box}, \texttt{dim}, \texttt{int} and
+% \texttt{skip} lists. (An inline token list mapping would read better here,
+% but this does not work until \texttt{int} allocation is available!) Note
+% that \texttt{box255} is reserved by \TeX{} itself (\LuaTeX{} does make
+% this alterable, but that doesn't really do much for us so we ignore
+% that!)
% \begin{macrocode}
-\tl_const:Nn \c__dim_allocation_reserve_begin_tl { 221 }
-\tl_const:Nn \c__dim_allocation_reserve_end_tl { 255 }
-\tl_const:Nn \c__int_allocation_reserve_begin_tl { 221 }
-\tl_const:Nn \c__int_allocation_reserve_end_tl { 255 }
+\tl_const:Nn \c__box_allocation_reserve_begin_tl { 221 }
+\tl_const:Nn \c__box_allocation_reserve_end_tl { 255 }
+\tl_const:Nn \c__dim_allocation_reserve_begin_tl { 221 }
+\tl_const:Nn \c__dim_allocation_reserve_end_tl { 254 }
+\tl_const:Nn \c__int_allocation_reserve_begin_tl { 221 }
+\tl_const:Nn \c__int_allocation_reserve_end_tl { 254 }
\tl_const:Nn \c__skip_allocation_reserve_begin_tl { 221 }
-\tl_const:Nn \c__skip_allocation_reserve_end_tl { 255 }
-% \end{macrocode}
-% Reserve a space in the \texttt{box} list: box~255 is special in addition
-% to dealing with inserts, so the end point here is different.
-% \begin{macrocode}
-\tl_const:Nn \c__box_allocation_reserve_begin_tl { 221 }
-\tl_const:Nn \c__box_allocation_reserve_end_tl { 255 }
+\tl_const:Nn \c__skip_allocation_reserve_end_tl { 254 }
% \end{macrocode}
% \end{macro}
%