* lisp.h (toplevel): Add two notices to the comment about
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 26 Dec 2012 14:10:11 +0000 (18:10 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Wed, 26 Dec 2012 14:10:11 +0000 (18:10 +0400)
defining a new Lisp data type.

src/ChangeLog
src/lisp.h

index 8a22821..d0e0831 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-26  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * lisp.h (toplevel): Add two notices to the comment about
+       defining a new Lisp data type.
+
 2012-12-26  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * keyboard.c (record_asynch_buffer_change): Initialize an event
index cfdff6c..d8d61e4 100644 (file)
@@ -325,6 +325,10 @@ enum Lisp_Fwd_Type
    members that are accessible only from C.  A Lisp_Misc object is a
    wrapper for a C struct that can contain anything you like.
 
+   Explicit freeing is discouraged for Lisp objects in general.  But if
+   you really need to exploit this, use Lisp_Misc (check free_misc in
+   alloc.c to see why).  There is no way to free a vectorlike object.
+
    To add a new pseudovector type, extend the pvec_type enumeration;
    to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration.
 
@@ -334,6 +338,10 @@ enum Lisp_Fwd_Type
    enumeration and a 1-bit GC markbit) and make sure the overall size
    of the union is not increased by your addition.
 
+   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).
+   Otherwise you will need to change sweep_vectors (also in alloc.c).
+
    Then you will need to add switch branches in print.c (in
    print_object, to print your object, and possibly also in
    print_preprocess) and to alloc.c, to mark your object (in