]> git.eshelyaron.com Git - emacs.git/commitdiff
better compilation unit definition
authorAndrea Corallo <akrl@sdf.org>
Sun, 22 Dec 2019 07:31:02 +0000 (08:31 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:14 +0000 (11:38 +0100)
src/alloc.c
src/comp.h
src/lisp.h

index d47f9c8a574e9e9a50eb8132ff1f01c80a41b90d..5e0b04b1cc703721b65e41b21f565898e0ef6021 100644 (file)
@@ -6572,13 +6572,9 @@ mark_object (Lisp_Object arg)
                struct Lisp_Subr *subr = XSUBR (obj);
                mark_object (subr->native_comp_u);
              }
-           break;
-         case PVEC_NATIVE_COMP_UNIT:
-           set_vector_marked (ptr);
-           /* FIXME see comp.h.  */
-           mark_object (XNATIVE_COMP_UNIT (obj)->data_vec);
 #endif
            break;
+
          case PVEC_FREE:
            emacs_abort ();
 
index 04c5727866723d528be47a94ef4daeef5eb029dc..8b83911f53c15f70bd12f52b1382500516063b7b 100644 (file)
@@ -26,10 +26,11 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 struct Lisp_Native_Comp_Unit
 {
   union vectorlike_header header;
+  /* Analogous to the constant vector but per compilation unit.  */
+  Lisp_Object data_vec;
   /* Compilation unit file descriptor and handle.  */
   int fd;
   dynlib_handle_ptr handle;
-  Lisp_Object data_vec; /* FIXME this should be in the normal lisp slot.  */
 };
 
 INLINE bool
index 2e4a6c898467b2ee8129b84473dda9ee3a979ca8..81ccae5683ff4807501ec600644096ff64723610 100644 (file)
@@ -4773,10 +4773,8 @@ INLINE Lisp_Object
 make_native_comp_u (int fd, dynlib_handle_ptr handle)
 {
   struct Lisp_Native_Comp_Unit *x =
-    (struct Lisp_Native_Comp_Unit *) allocate_pseudovector (
-                                      VECSIZE (struct Lisp_Native_Comp_Unit),
-                                      0, VECSIZE (struct Lisp_Native_Comp_Unit),
-                                      PVEC_NATIVE_COMP_UNIT);
+    ALLOCATE_ZEROED_PSEUDOVECTOR (struct Lisp_Native_Comp_Unit, data_vec,
+                                 PVEC_NATIVE_COMP_UNIT);
   x->fd = fd;
   x->handle = handle;
   Lisp_Object cu;