From a88e5f0f199ad018d57d07016dce20e5462dbbca Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 22 Dec 2019 08:31:02 +0100 Subject: [PATCH] better compilation unit definition --- src/alloc.c | 6 +----- src/comp.h | 3 ++- src/lisp.h | 6 ++---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index d47f9c8a574..5e0b04b1cc7 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -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 (); diff --git a/src/comp.h b/src/comp.h index 04c57278667..8b83911f53c 100644 --- a/src/comp.h +++ b/src/comp.h @@ -26,10 +26,11 @@ along with GNU Emacs. If not, see . */ 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 diff --git a/src/lisp.h b/src/lisp.h index 2e4a6c89846..81ccae5683f 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -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; -- 2.39.5