emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 c54cf8d: Improve commentary in lisp.h


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 c54cf8d: Improve commentary in lisp.h
Date: Fri, 10 Feb 2017 05:13:13 -0500 (EST)

branch: emacs-25
commit c54cf8dcfd016783bc4881eb218d7b556020a18c
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Improve commentary in lisp.h
    
    * src/lisp.h: Explain in the comment why enlarging a Lisp_Misc
    object is discouraged.
---
 src/lisp.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/lisp.h b/src/lisp.h
index b410ee4..5aee80c 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -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_Misc, but 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).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]