]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve commentary in lisp.h
authorEli Zaretskii <eliz@gnu.org>
Fri, 10 Feb 2017 10:12:49 +0000 (12:12 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 10 Feb 2017 10:12:49 +0000 (12:12 +0200)
* src/lisp.h: Explain in the comment why enlarging a Lisp_Misc
object is discouraged.

src/lisp.h

index b410ee45aed3a91bcdc73dfca487df25b14a3254..5aee80cea118987c965fb4979caae427e02a0140 100644 (file)
@@ -511,10 +511,14 @@ enum Lisp_Fwd_Type
    to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration.
 
    For a Lisp_Misc, you will also need to add your entry to union
-   Lisp_Misc (but make sure the first word has the same structure as
+   Lisp_Miscbut make sure the first word has the same structure as
    the others, starting with a 16-bit member of the Lisp_Misc_Type
-   enumeration and a 1-bit GC markbit) and make sure the overall size
-   of the union is not increased by your addition.
+   enumeration and a 1-bit GC markbit.  Also make sure the overall
+   size of the union is not increased by your addition.  The latter
+   requirement is to keep Lisp_Misc objects small enough, so they
+   are handled faster: since all Lisp_Misc types use the same space,
+   enlarging any of them will affect all the rest.  If you really
+   need a larger object, it is best to use Lisp_Vectorlike instead.
 
    For a new pseudovector, it's highly desirable to limit the size
    of your data type by VBLOCK_BYTES_MAX bytes (defined in alloc.c).