From 7e63e0c3c6c94188a614cdd934a8e784c295fdc5 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Sun, 29 Jul 2012 21:14:51 +0400 Subject: [PATCH] Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check. * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long time. Adjust users. (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list. --- src/ChangeLog | 7 +++++++ src/alloc.c | 9 ++------- src/eval.c | 10 +++++----- src/lisp.h | 47 +++++++---------------------------------------- 4 files changed, 21 insertions(+), 52 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d6143d15bde..8a0f998cfc6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-07-29 Dmitry Antipov + + Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check. + * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long + time. Adjust users. + (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list. + 2012-07-29 Jan Djärv * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before diff --git a/src/alloc.c b/src/alloc.c index 7680b3a2d84..f6f656fffa3 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -29,11 +29,6 @@ along with GNU Emacs. If not, see . */ #include #endif -/* This file is part of the core Lisp implementation, and thus must - deal with the real data structures. If the Lisp implementation is - replaced, this file likely will not be used. */ - -#undef HIDE_LISP_IMPLEMENTATION #include "lisp.h" #include "process.h" #include "intervals.h" @@ -5447,7 +5442,7 @@ See Info node `(elisp)Garbage Collection'. */) if (pure_bytes_used_before_overflow) return Qnil; - CHECK_CONS_LIST (); + check_cons_list (); /* Don't keep undo information around forever. Do this early on, so it is no problem if the user quits. */ @@ -5615,7 +5610,7 @@ See Info node `(elisp)Garbage Collection'. */) UNBLOCK_INPUT; - CHECK_CONS_LIST (); + check_cons_list (); gc_in_progress = 0; diff --git a/src/eval.c b/src/eval.c index a0a05ebf0dc..e6cd4e8dc27 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2094,7 +2094,7 @@ eval_sub (Lisp_Object form) args_left = original_args; numargs = Flength (args_left); - CHECK_CONS_LIST (); + check_cons_list (); if (XINT (numargs) < XSUBR (fun)->min_args || (XSUBR (fun)->max_args >= 0 @@ -2222,7 +2222,7 @@ eval_sub (Lisp_Object form) else xsignal1 (Qinvalid_function, original_fun); } - CHECK_CONS_LIST (); + check_cons_list (); lisp_eval_depth--; if (backtrace.debug_on_exit) @@ -2762,7 +2762,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) if (debug_on_next_call) do_debug_on_call (Qlambda); - CHECK_CONS_LIST (); + check_cons_list (); original_fun = args[0]; @@ -2871,13 +2871,13 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) else if (EQ (funcar, Qautoload)) { Fautoload_do_load (fun, original_fun, Qnil); - CHECK_CONS_LIST (); + check_cons_list (); goto retry; } else xsignal1 (Qinvalid_function, original_fun); } - CHECK_CONS_LIST (); + check_cons_list (); lisp_eval_depth--; if (backtrace.debug_on_exit) val = call_debugger (Fcons (Qexit, Fcons (val, Qnil))); diff --git a/src/lisp.h b/src/lisp.h index a45e9c2c892..a7d120a6985 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -28,20 +28,6 @@ along with GNU Emacs. If not, see . */ #include -/* Use the configure flag --enable-checking[=LIST] to enable various - types of run time checks for Lisp objects. */ - -#ifdef GC_CHECK_CONS_LIST -extern void check_cons_list (void); -#define CHECK_CONS_LIST() check_cons_list () -#else -#define CHECK_CONS_LIST() ((void) 0) -#endif - -/* Temporarily disable wider-than-pointer integers until they're tested more. - Build with CFLAGS='-DWIDE_EMACS_INT' to try them out. */ -/* #undef WIDE_EMACS_INT */ - /* EMACS_INT - signed integer wide enough to hold an Emacs value EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if pI - printf length modifier for EMACS_INT @@ -642,21 +628,12 @@ struct Lisp_Cons { /* Please do not use the names of these elements in code other than the core lisp implementation. Use XCAR and XCDR below. */ -#ifdef HIDE_LISP_IMPLEMENTATION - Lisp_Object car_; - union - { - Lisp_Object cdr_; - struct Lisp_Cons *chain; - } u; -#else Lisp_Object car; union { Lisp_Object cdr; struct Lisp_Cons *chain; } u; -#endif }; /* Take the car or cdr of something known to be a cons cell. */ @@ -666,13 +643,8 @@ struct Lisp_Cons fields are not accessible as lvalues. (What if we want to switch to a copying collector someday? Cached cons cell field addresses may be invalidated at arbitrary points.) */ -#ifdef HIDE_LISP_IMPLEMENTATION -#define XCAR_AS_LVALUE(c) (XCONS ((c))->car_) -#define XCDR_AS_LVALUE(c) (XCONS ((c))->u.cdr_) -#else #define XCAR_AS_LVALUE(c) (XCONS ((c))->car) #define XCDR_AS_LVALUE(c) (XCONS ((c))->u.cdr) -#endif /* Use these from normal code. */ #define XCAR(c) LISP_MAKE_RVALUE (XCAR_AS_LVALUE (c)) @@ -1485,23 +1457,13 @@ struct Lisp_Float { union { -#ifdef HIDE_LISP_IMPLEMENTATION - double data_; -#else double data; -#endif struct Lisp_Float *chain; } u; }; -#ifdef HIDE_LISP_IMPLEMENTATION -#define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data_ : XFLOAT (f)->u.data_) -#else -#define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data : XFLOAT (f)->u.data) -/* This should be used only in alloc.c, which always disables - HIDE_LISP_IMPLEMENTATION. */ -#define XFLOAT_INIT(f,n) (XFLOAT (f)->u.data = (n)) -#endif +#define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data : XFLOAT (f)->u.data) +#define XFLOAT_INIT(f, n) (XFLOAT (f)->u.data = (n)) /* A character, declared with the following typedef, is a member of some character set associated with the current buffer. */ @@ -2702,6 +2664,11 @@ extern void init_alloc (void); extern void syms_of_alloc (void); extern struct buffer * allocate_buffer (void); extern int valid_lisp_object_p (Lisp_Object); +#ifdef GC_CHECK_CONS_LIST +extern void check_cons_list (void); +#else +#define check_cons_list() ((void) 0) +#endif #ifdef REL_ALLOC /* Defined in ralloc.c */ -- 2.39.2