Mercurial > hg > xemacs-beta
comparison man/internals/internals.texi @ 5582:873d7425c1ad
Change integer to fixnum in a few places where it wasn't possible mechanically.
src/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
Do a couple of non-mechanical things that would otherwise have
been included in the last change.
* data.c:
* data.c (Ftype_of):
Return Qfixnum for fixnums, not Qinteger.
* lisp.h (MOST_POSITIVE_FIXNUM):
Delete an obsolete comment here.
man/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
* internals/internals.texi (Top):
* internals/internals.texi (Authorship of XEmacs):
* internals/internals.texi (Modules for Other Aspects of the Lisp Interpreter and Object System):
* internals/internals.texi (Introduction to Writing C Code):
* internals/internals.texi (Working with Lisp Objects):
* internals/internals.texi (Adding Global Lisp Variables):
* internals/internals.texi (The XEmacs Object System (Abstractly Speaking)):
* internals/internals.texi (How Lisp Objects Are Represented in C):
* internals/internals.texi (Allocation of Objects in XEmacs Lisp):
* internals/internals.texi (Introduction to Allocation):
* internals/internals.texi (GCPROing):
* internals/internals.texi (mark_object):
* internals/internals.texi (sweep_bit_vectors_1):
* internals/internals.texi (Fixnums and Characters):
* internals/internals.texi (Future Work -- Unicode):
Say fixnum rather than integer when specifically talking about
fixed-width Lisp integers.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 09 Oct 2011 10:39:09 +0100 |
parents | 56144c8593a8 |
children | 1a507c4c6c42 |
comparison
equal
deleted
inserted
replaced
5581:56144c8593a8 | 5582:873d7425c1ad |
---|---|
465 | 465 |
466 * Introduction to Allocation:: | 466 * Introduction to Allocation:: |
467 * Garbage Collection:: | 467 * Garbage Collection:: |
468 * GCPROing:: | 468 * GCPROing:: |
469 * Garbage Collection - Step by Step:: | 469 * Garbage Collection - Step by Step:: |
470 * Integers and Characters:: | 470 * Fixnums and Characters:: |
471 * Allocation from Frob Blocks:: | 471 * Allocation from Frob Blocks:: |
472 * lrecords:: | 472 * lrecords:: |
473 * Low-level allocation:: | 473 * Low-level allocation:: |
474 * Cons:: | 474 * Cons:: |
475 * Vector:: | 475 * Vector:: |
946 | 946 |
947 @table @asis | 947 @table @asis |
948 @item Objects | 948 @item Objects |
949 @itemize @minus | 949 @itemize @minus |
950 @item | 950 @item |
951 Conversion from 26-bit to 28-bit pointers and integers, lrecords, lcrecords: Richard Mlynarik, 1994 | 951 Conversion from 26-bit to 28-bit pointers and fixnums, lrecords, lcrecords: Richard Mlynarik, 1994 |
952 @item | 952 @item |
953 Conversion to 32-bit pointers and 31-bit integers: Kyle Jones, Martin Buchholz | 953 Conversion to 32-bit pointers and 31-bit fixnums: Kyle Jones, Martin Buchholz |
954 @item | 954 @item |
955 Portable dumper, object descriptions: Olivier Galibert | 955 Portable dumper, object descriptions: Olivier Galibert |
956 @item | 956 @item |
957 KKCC (new garbage collector), ephemerons, weak boxes: Michael Sperber and students | 957 KKCC (new garbage collector), ephemerons, weak boxes: Michael Sperber and students |
958 @item | 958 @item |
1152 the Lisp reference manual, and responsible for much of the synching | 1152 the Lisp reference manual, and responsible for much of the synching |
1153 between XEmacs and GNU Emacs. | 1153 between XEmacs and GNU Emacs. |
1154 | 1154 |
1155 @item Kyle Jones | 1155 @item Kyle Jones |
1156 Author of the minimal tag bits support, which allows for 32-bit | 1156 Author of the minimal tag bits support, which allows for 32-bit |
1157 pointers and 31-bit integers. | 1157 pointers and 31-bit fixnums. |
1158 | 1158 |
1159 @item Olivier Galibert | 1159 @item Olivier Galibert |
1160 Author of the portable dumping mechanism. | 1160 Author of the portable dumping mechanism. |
1161 | 1161 |
1162 @item Andy Piper | 1162 @item Andy Piper |
1198 string resizes. Ben Wing also added bit factors for 1913 around | 1198 string resizes. Ben Wing also added bit factors for 1913 around |
1199 September 1995, and Elsie record lists for 1914 around December 1995. | 1199 September 1995, and Elsie record lists for 1914 around December 1995. |
1200 Steve Baur did some work on the purification and dump time code, and | 1200 Steve Baur did some work on the purification and dump time code, and |
1201 added Doug Lea Malloc support from Emacs 20.2 circa 1998. Kyle Jones | 1201 added Doug Lea Malloc support from Emacs 20.2 circa 1998. Kyle Jones |
1202 continued to work done by Mlynarik, reducing the number of primitive | 1202 continued to work done by Mlynarik, reducing the number of primitive |
1203 Lisp types so that there are only three: integer character and pointer | 1203 Lisp types so that there are only three: fixnum, character, and pointer |
1204 type, which encompasses all other types. This allows for 31-bit | 1204 type, which encompasses all other types. This allows for 31-bit |
1205 integers and 32-bit pointers, although there is potential slowdown in | 1205 fixnums and 32-bit pointers, although there is potential slowdown in |
1206 some extra in directions when determining the type of an object, and | 1206 some extra in directions when determining the type of an object, and |
1207 some memory increase for the objects that previously were considered to | 1207 some memory increase for the objects that previously were considered to |
1208 be the most primitive types. Martin Buchholz has recently (February | 1208 be the most primitive types. Martin Buchholz has recently (February |
1209 2000) done some work to eliminate most of the slowdown. | 1209 2000) done some work to eliminate most of the slowdown. |
1210 | 1210 |
4082 @example | 4082 @example |
4083 @file{rangetab.c} | 4083 @file{rangetab.c} |
4084 @end example | 4084 @end example |
4085 | 4085 |
4086 This module implements the @dfn{range table} Lisp object type, which | 4086 This module implements the @dfn{range table} Lisp object type, which |
4087 provides for a mapping from ranges of integers to arbitrary Lisp | 4087 provides for a mapping from ranges of fixnums to arbitrary Lisp |
4088 objects. | 4088 objects. |
4089 | 4089 |
4090 | 4090 |
4091 | 4091 |
4092 @example | 4092 @example |
4979 includes variables that forward into Lisp variables plus others like | 4979 includes variables that forward into Lisp variables plus others like |
4980 Vselected_console) begin with a capital V. | 4980 Vselected_console) begin with a capital V. |
4981 @item | 4981 @item |
4982 No C variables whose value is other than a Lisp_Object should begin | 4982 No C variables whose value is other than a Lisp_Object should begin |
4983 with a capital V. (This includes C variables that forward into | 4983 with a capital V. (This includes C variables that forward into |
4984 integer or boolean Lisp variables.) | 4984 fixnums or boolean Lisp variables.) |
4985 @item | 4985 @item |
4986 All global C variables whose value is a struct Lisp_Subr begin with a | 4986 All global C variables whose value is a struct Lisp_Subr begin with a |
4987 capital S. (This only occurs in connection with DEFUN ()). | 4987 capital S. (This only occurs in connection with DEFUN ()). |
4988 @item | 4988 @item |
4989 All C functions that are Lisp primitives begin with a capital F, | 4989 All C functions that are Lisp primitives begin with a capital F, |
5156 obvious. | 5156 obvious. |
5157 | 5157 |
5158 All Lisp objects are handled indirectly. The @code{Lisp_Object} | 5158 All Lisp objects are handled indirectly. The @code{Lisp_Object} |
5159 type is usually a pointer to a structure, except for a very small number | 5159 type is usually a pointer to a structure, except for a very small number |
5160 of types with immediate representations (currently characters and | 5160 of types with immediate representations (currently characters and |
5161 integers). However, these types cannot be directly operated on in C | 5161 fixnums). However, these types cannot be directly operated on in C |
5162 code, either, so they can also be considered indirect. Types that do | 5162 code, either, so they can also be considered indirect. Types that do |
5163 not have an immediate representation always have a C typedef | 5163 not have an immediate representation always have a C typedef |
5164 @code{Lisp_@var{type}} for a corresponding structure. | 5164 @code{Lisp_@var{type}} for a corresponding structure. |
5165 @c #### mention l(c)records here? | 5165 @c #### mention l(c)records here? |
5166 | 5166 |
5207 XEmacs it also does some error-checking, which you normally want.) | 5207 XEmacs it also does some error-checking, which you normally want.) |
5208 | 5208 |
5209 @strong{Convention}: Global variables whose names begin with @samp{V} | 5209 @strong{Convention}: Global variables whose names begin with @samp{V} |
5210 are variables that contain Lisp objects. The convention here is that | 5210 are variables that contain Lisp objects. The convention here is that |
5211 all global variables of type @code{Lisp_Object} begin with @samp{V}, and | 5211 all global variables of type @code{Lisp_Object} begin with @samp{V}, and |
5212 no others do (not even integer and boolean variables that have Lisp | 5212 no others do (not even fixnum and boolean variables that have Lisp |
5213 equivalents). Most of the time, these variables have equivalents in | 5213 equivalents). Most of the time, these variables have equivalents in |
5214 Lisp, which are defined via the @samp{DEFVAR} family of macros, but some | 5214 Lisp, which are defined via the @samp{DEFVAR} family of macros, but some |
5215 don't. Since the variable's value is a @code{Lisp_Object}, it can be | 5215 don't. Since the variable's value is a @code{Lisp_Object}, it can be |
5216 passed to Lisp primitives. | 5216 passed to Lisp primitives. |
5217 | 5217 |
5720 convenient and less error-prone than doing it in your module. | 5720 convenient and less error-prone than doing it in your module. |
5721 | 5721 |
5722 Global variables whose names begin with @samp{V} are variables that | 5722 Global variables whose names begin with @samp{V} are variables that |
5723 contain Lisp objects. The convention here is that all global variables | 5723 contain Lisp objects. The convention here is that all global variables |
5724 of type @code{Lisp_Object} begin with @samp{V}, and all others don't | 5724 of type @code{Lisp_Object} begin with @samp{V}, and all others don't |
5725 (including integer and boolean variables that have Lisp | 5725 (including fixnum and boolean variables that have Lisp |
5726 equivalents). Most of the time, these variables have equivalents in | 5726 equivalents). Most of the time, these variables have equivalents in |
5727 Lisp, but some don't. Those that do are declared this way by a call to | 5727 Lisp, but some don't. Those that do are declared this way by a call to |
5728 @code{DEFVAR_LISP()} in the @code{vars_of_*()} initializer for the | 5728 @code{DEFVAR_LISP()} in the @code{vars_of_*()} initializer for the |
5729 module. What this does is create a special @dfn{symbol-value-forward} | 5729 module. What this does is create a special @dfn{symbol-value-forward} |
5730 Lisp object that contains a pointer to the C variable, intern a symbol | 5730 Lisp object that contains a pointer to the C variable, intern a symbol |
7500 in its internal operations.) | 7500 in its internal operations.) |
7501 | 7501 |
7502 The basic Lisp objects are | 7502 The basic Lisp objects are |
7503 | 7503 |
7504 @table @code | 7504 @table @code |
7505 @item integer | 7505 @item fixnum |
7506 31 bits of precision, or 63 bits on 64-bit machines; the | 7506 An integer with 31 bits of precision, or 63 bits on 64-bit machines; the |
7507 reason for this is described below when the internal Lisp object | 7507 reason for this is described below when the internal Lisp object |
7508 representation is described. | 7508 representation is described. |
7509 @item char | 7509 @item char |
7510 An object representing a single character of text; chars behave like | 7510 An object representing a single character of text; chars behave like |
7511 integers in many ways but are logically considered text rather than | 7511 integers in many ways but are logically considered text rather than |
7514 a Japanese Kanji character might be encoded as @samp{^[$(B#&^[(B} using the | 7514 a Japanese Kanji character might be encoded as @samp{^[$(B#&^[(B} using the |
7515 ISO-2022 encoding standard---rather than the numerical representation | 7515 ISO-2022 encoding standard---rather than the numerical representation |
7516 of the char; this way, if the mapping between chars and integers | 7516 of the char; this way, if the mapping between chars and integers |
7517 changes, which is quite possible for Kanji characters and other extended | 7517 changes, which is quite possible for Kanji characters and other extended |
7518 characters, the same character will still be created. Note that some | 7518 characters, the same character will still be created. Note that some |
7519 primitives confuse chars and integers. The worst culprit is @code{eq}, | 7519 primitives confuse chars and fixnum. |
7520 which makes a special exception and considers a char to be @code{eq} to | |
7521 its integer equivalent, even though in no other case are objects of two | |
7522 different types @code{eq}. The reason for this monstrosity is | |
7523 compatibility with existing code; the separation of char from integer | |
7524 came fairly recently.) | |
7525 @item float | 7520 @item float |
7526 Same precision as a double in C. | 7521 Same precision as a double in C. |
7527 @item bignum | 7522 @item bignum |
7528 @itemx ratio | 7523 @itemx ratio |
7529 @itemx bigfloat | 7524 @itemx bigfloat |
7530 As build-time options, arbitrary-precision numbers are available. | 7525 As build-time options, arbitrary-precision numbers are available. |
7531 Bignums are integers, and when available they remove the restriction on | 7526 Bignums are integers. Ratios are non-integral rational numbers. |
7532 buffer size. Ratios are non-integral rational numbers. Bigfloats are | 7527 Bigfloats are arbitrary-precision floating point numbers, with |
7533 arbitrary-precision floating point numbers, with precision specified at | 7528 precision specified at runtime. |
7534 runtime. | |
7535 @item symbol | 7529 @item symbol |
7536 An object that contains Lisp objects and is referred to by name; | 7530 An object that contains Lisp objects and is referred to by name; |
7537 symbols are used to implement variables and named functions | 7531 symbols are used to implement variables and named functions |
7538 and to provide the equivalent of preprocessor constants in C. | 7532 and to provide the equivalent of preprocessor constants in C. |
7539 @item string | 7533 @item string |
7640 An object that maps from chars or classes of chars to arbitrary Lisp | 7634 An object that maps from chars or classes of chars to arbitrary Lisp |
7641 objects; internally char tables use a complex nested-vector | 7635 objects; internally char tables use a complex nested-vector |
7642 representation that is optimized to the way characters are represented | 7636 representation that is optimized to the way characters are represented |
7643 as integers. | 7637 as integers. |
7644 @item range-table | 7638 @item range-table |
7645 An object that maps from ranges of integers to arbitrary Lisp objects. | 7639 An object that maps from ranges of fixnums to arbitrary Lisp objects. |
7646 @end table | 7640 @end table |
7647 | 7641 |
7648 And some strange special-purpose objects: | 7642 And some strange special-purpose objects: |
7649 | 7643 |
7650 @table @code | 7644 @table @code |
7867 @example | 7861 @example |
7868 [ 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 ] | 7862 [ 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 ] |
7869 [ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 ] | 7863 [ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 ] |
7870 | 7864 |
7871 <---------------------------------------------------------> <-> | 7865 <---------------------------------------------------------> <-> |
7872 a pointer to a structure, or an integer tag | 7866 a pointer to a structure, or a fixnum tag |
7873 @end example | 7867 @end example |
7874 | 7868 |
7875 A tag of 00 is used for all pointer object types, a tag of 10 is used | 7869 A tag of 00 is used for all pointer object types, a tag of 10 is used |
7876 for characters, and the other two tags 01 and 11 are joined together to | 7870 for characters, and the other two tags 01 and 11 are joined together to |
7877 form the integer object type. This representation gives us 31 bit | 7871 form the fixnum object type. This representation gives us 31 bit |
7878 integers and 30 bit characters, while pointers are represented directly | 7872 fixnums and 30 bit characters, while pointers are represented directly |
7879 without any bit masking or shifting. This representation, though, | 7873 without any bit masking or shifting. This representation, though, |
7880 assumes that pointers to structs are always aligned to multiples of 4, | 7874 assumes that pointers to structs are always aligned to multiples of 4, |
7881 so the lower 2 bits are always zero. | 7875 so the lower 2 bits are always zero. |
7882 | 7876 |
7883 Lisp objects use the typedef @code{Lisp_Object}, but the actual C type | 7877 Lisp objects use the typedef @code{Lisp_Object}, but the actual C type |
7897 Various macros are used to convert between Lisp_Objects and the | 7891 Various macros are used to convert between Lisp_Objects and the |
7898 corresponding C type. Macros of the form @code{XFIXNUM()}, @code{XCHAR()}, | 7892 corresponding C type. Macros of the form @code{XFIXNUM()}, @code{XCHAR()}, |
7899 @code{XSTRING()}, @code{XSYMBOL()}, do any required bit shifting and/or | 7893 @code{XSTRING()}, @code{XSYMBOL()}, do any required bit shifting and/or |
7900 masking and cast it to the appropriate type. @code{XFIXNUM()} needs to be | 7894 masking and cast it to the appropriate type. @code{XFIXNUM()} needs to be |
7901 a bit tricky so that negative numbers are properly sign-extended. Since | 7895 a bit tricky so that negative numbers are properly sign-extended. Since |
7902 integers are stored left-shifted, if the right-shift operator does an | 7896 fixnums are stored left-shifted, if the right-shift operator does an |
7903 arithmetic shift (i.e. it leaves the most-significant bit as-is rather | 7897 arithmetic shift (i.e. it leaves the most-significant bit as-is rather |
7904 than shifting in a zero, so that it mimics a divide-by-two even for | 7898 than shifting in a zero, so that it mimics a divide-by-two even for |
7905 negative numbers) the shift to remove the tag bit is enough. This is | 7899 negative numbers) the shift to remove the tag bit is enough. This is |
7906 the case on all the systems we support. | 7900 the case on all the systems we support. |
7907 | 7901 |
7916 There are similar @code{XSET@var{TYPE}()} macros that construct a Lisp | 7910 There are similar @code{XSET@var{TYPE}()} macros that construct a Lisp |
7917 object. These macros are of the form @code{XSET@var{TYPE} | 7911 object. These macros are of the form @code{XSET@var{TYPE} |
7918 (@var{lvalue}, @var{result})}, i.e. they have to be a statement rather | 7912 (@var{lvalue}, @var{result})}, i.e. they have to be a statement rather |
7919 than just used in an expression. The reason for this is that standard C | 7913 than just used in an expression. The reason for this is that standard C |
7920 doesn't let you ``construct'' a structure (but GCC does). Granted, this | 7914 doesn't let you ``construct'' a structure (but GCC does). Granted, this |
7921 sometimes isn't too convenient; for the case of integers, at least, you | 7915 sometimes isn't too convenient; for the case of fixnums, at least, you |
7922 can use the function @code{make_fixnum()}, which constructs and | 7916 can use the function @code{make_fixnum()}, which constructs and |
7923 @emph{returns} an integer Lisp object. Note that the | 7917 @emph{returns} an integer Lisp object. Note that the |
7924 @code{XSET@var{TYPE}()} macros are also affected by | 7918 @code{XSET@var{TYPE}()} macros are also affected by |
7925 @code{ERROR_CHECK_TYPES} and make sure that the structure is of the | 7919 @code{ERROR_CHECK_TYPES} and make sure that the structure is of the |
7926 right type in the case of record types, where the type is contained in | 7920 right type in the case of record types, where the type is contained in |
7948 @menu | 7942 @menu |
7949 * Introduction to Allocation:: | 7943 * Introduction to Allocation:: |
7950 * Garbage Collection:: | 7944 * Garbage Collection:: |
7951 * GCPROing:: | 7945 * GCPROing:: |
7952 * Garbage Collection - Step by Step:: | 7946 * Garbage Collection - Step by Step:: |
7953 * Integers and Characters:: | 7947 * Fixnums and Characters:: |
7954 * Allocation from Frob Blocks:: | 7948 * Allocation from Frob Blocks:: |
7955 * lrecords:: | 7949 * lrecords:: |
7956 * Low-level allocation:: | 7950 * Low-level allocation:: |
7957 * Cons:: | 7951 * Cons:: |
7958 * Vector:: | 7952 * Vector:: |
7991 into three broad categories: | 7985 into three broad categories: |
7992 | 7986 |
7993 @itemize @bullet | 7987 @itemize @bullet |
7994 @item | 7988 @item |
7995 (a) Those for whom the value directly represents the contents of the | 7989 (a) Those for whom the value directly represents the contents of the |
7996 Lisp object. Only two types are in this category: integers and | 7990 Lisp object. Only two types are in this category: fixnums and |
7997 characters. No special allocation or garbage collection is necessary | 7991 characters. No special allocation or garbage collection is necessary |
7998 for such objects. Lisp objects of these types do not need to be | 7992 for such objects. Lisp objects of these types do not need to be |
7999 @code{GCPRO}ed. | 7993 @code{GCPRO}ed. |
8000 @end itemize | 7994 @end itemize |
8001 | 7995 |
8232 anything that looks like a reference to an object as a reference. This | 8226 anything that looks like a reference to an object as a reference. This |
8233 will result in a few objects not getting collected when they should, but | 8227 will result in a few objects not getting collected when they should, but |
8234 it obviates the need for @code{GCPRO}ing, and allows garbage collection | 8228 it obviates the need for @code{GCPRO}ing, and allows garbage collection |
8235 to happen at any point at all, such as during object allocation. | 8229 to happen at any point at all, such as during object allocation. |
8236 | 8230 |
8237 @node Garbage Collection - Step by Step, Integers and Characters, GCPROing, Allocation of Objects in XEmacs Lisp | 8231 @node Garbage Collection - Step by Step, Fixnums and Characters, GCPROing, Allocation of Objects in XEmacs Lisp |
8238 @section Garbage Collection - Step by Step | 8232 @section Garbage Collection - Step by Step |
8239 @cindex garbage collection - step by step | 8233 @cindex garbage collection - step by step |
8240 | 8234 |
8241 @menu | 8235 @menu |
8242 * Invocation:: | 8236 * Invocation:: |
8502 @node mark_object, gc_sweep, garbage_collect_1, Garbage Collection - Step by Step | 8496 @node mark_object, gc_sweep, garbage_collect_1, Garbage Collection - Step by Step |
8503 @subsection @code{mark_object} | 8497 @subsection @code{mark_object} |
8504 @cindex @code{mark_object} | 8498 @cindex @code{mark_object} |
8505 | 8499 |
8506 The first thing that is checked while marking an object is whether the | 8500 The first thing that is checked while marking an object is whether the |
8507 object is a real Lisp object @code{Lisp_Type_Record} or just an integer | 8501 object is a real Lisp object @code{Lisp_Type_Record} or just a fixnum |
8508 or a character. Integers and characters are the only two types that are | 8502 or a character. Fixnums and characters are the only two types that are |
8509 stored directly - without another level of indirection, and therefore they | 8503 stored directly - without another level of indirection, and therefore they |
8510 don't have to be marked and collected. | 8504 don't have to be marked and collected. |
8511 @xref{How Lisp Objects Are Represented in C}. | 8505 @xref{How Lisp Objects Are Represented in C}. |
8512 | 8506 |
8513 The second case is the one we have to handle. It is the one when we are | 8507 The second case is the one we have to handle. It is the one when we are |
8728 all unmarked bit vectors are unlinked by calling @code{xfree} and all of | 8722 all unmarked bit vectors are unlinked by calling @code{xfree} and all of |
8729 them become unmarked. | 8723 them become unmarked. |
8730 In addition, the bookkeeping information used for garbage | 8724 In addition, the bookkeeping information used for garbage |
8731 collector's output purposes is updated. | 8725 collector's output purposes is updated. |
8732 | 8726 |
8733 @node Integers and Characters, Allocation from Frob Blocks, Garbage Collection - Step by Step, Allocation of Objects in XEmacs Lisp | 8727 @node Fixnums and Characters, Allocation from Frob Blocks, Garbage Collection - Step by Step, Allocation of Objects in XEmacs Lisp |
8734 @section Integers and Characters | 8728 @section Fixnums and Characters |
8735 @cindex integers and characters | 8729 @cindex integers and characters |
8736 @cindex characters, integers and | 8730 @cindex characters, integers and |
8737 | 8731 @cindex fixnum and characters |
8738 Integer and character Lisp objects are created from integers using the | 8732 |
8733 Fixnum and character Lisp objects are created from C integers using the | |
8739 functions @code{make_fixnum()} and @code{make_char()}. (These are actually | 8734 functions @code{make_fixnum()} and @code{make_char()}. (These are actually |
8740 macros on most systems.) These functions basically just do some moving | 8735 macros on most systems.) These functions basically just do some moving |
8741 of bits around, since the integral value of the object is stored | 8736 of bits around, since the integral value of the object is stored |
8742 directly in the @code{Lisp_Object}. | 8737 directly in the @code{Lisp_Object}. |
8743 | 8738 |
8744 @node Allocation from Frob Blocks, lrecords, Integers and Characters, Allocation of Objects in XEmacs Lisp | 8739 @node Allocation from Frob Blocks, lrecords, Fixnums and Characters, Allocation of Objects in XEmacs Lisp |
8745 @section Allocation from Frob Blocks | 8740 @section Allocation from Frob Blocks |
8746 @cindex allocation from frob blocks | 8741 @cindex allocation from frob blocks |
8747 @cindex frob blocks, allocation from | 8742 @cindex frob blocks, allocation from |
8748 | 8743 |
8749 The uninitialized memory required by a @code{Lisp_Object} of a | 8744 The uninitialized memory required by a @code{Lisp_Object} of a |
26217 unicode list of char | 26212 unicode list of char |
26218 unicode string of char | 26213 unicode string of char |
26219 unicode vector or list of codes charset-offset | 26214 unicode vector or list of codes charset-offset |
26220 @end example | 26215 @end example |
26221 | 26216 |
26222 Establishes a mapping between a unicode codepoint (an integer) and | 26217 Establishes a mapping between a unicode codepoint (a fixnum) and |
26223 one or more chars in a charset. The mapping is automatically | 26218 one or more chars in a charset. The mapping is automatically |
26224 established in both directions. Chars in a charset can be specified | 26219 established in both directions. Chars in a charset can be specified |
26225 either with an actual character or a codepoint (i.e. an integer) | 26220 either with an actual character or a codepoint (i.e. an fixnum) |
26226 and the charset it's within. If a sequence of chars or charset | 26221 and the charset it's within. If a sequence of chars or charset |
26227 points is given, multiple mappings are established for consecutive | 26222 points is given, multiple mappings are established for consecutive |
26228 unicode codepoints starting with the given one. Charset codepoints | 26223 unicode codepoints starting with the given one. Charset codepoints |
26229 are specified as most-significant x 256 + least significant, with | 26224 are specified as most-significant x 256 + least significant, with |
26230 both bytes in the range 33-126 (for 94 or 94x94) or 32-127 (for 96 | 26225 both bytes in the range 33-126 (for 94 or 94x94) or 32-127 (for 96 |