diff options
| author | Dmitry Antipov | 2012-07-29 21:14:51 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-07-29 21:14:51 +0400 |
| commit | 7e63e0c3c6c94188a614cdd934a8e784c295fdc5 (patch) | |
| tree | a7e102cd4e204804b802d2e54c1bbfb94308c4ec /src | |
| parent | 1117bd24d198694f3f6922fa5c2abe5318b732cd (diff) | |
| download | emacs-7e63e0c3c6c94188a614cdd934a8e784c295fdc5.tar.gz emacs-7e63e0c3c6c94188a614cdd934a8e784c295fdc5.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/alloc.c | 9 | ||||
| -rw-r--r-- | src/eval.c | 10 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check. | ||
| 4 | * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long | ||
| 5 | time. Adjust users. | ||
| 6 | (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list. | ||
| 7 | |||
| 1 | 2012-07-29 Jan Djärv <jan.h.d@swipnet.se> | 8 | 2012-07-29 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 9 | ||
| 3 | * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before | 10 | * 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 <http://www.gnu.org/licenses/>. */ | |||
| 29 | #include <pthread.h> | 29 | #include <pthread.h> |
| 30 | #endif | 30 | #endif |
| 31 | 31 | ||
| 32 | /* This file is part of the core Lisp implementation, and thus must | ||
| 33 | deal with the real data structures. If the Lisp implementation is | ||
| 34 | replaced, this file likely will not be used. */ | ||
| 35 | |||
| 36 | #undef HIDE_LISP_IMPLEMENTATION | ||
| 37 | #include "lisp.h" | 32 | #include "lisp.h" |
| 38 | #include "process.h" | 33 | #include "process.h" |
| 39 | #include "intervals.h" | 34 | #include "intervals.h" |
| @@ -5447,7 +5442,7 @@ See Info node `(elisp)Garbage Collection'. */) | |||
| 5447 | if (pure_bytes_used_before_overflow) | 5442 | if (pure_bytes_used_before_overflow) |
| 5448 | return Qnil; | 5443 | return Qnil; |
| 5449 | 5444 | ||
| 5450 | CHECK_CONS_LIST (); | 5445 | check_cons_list (); |
| 5451 | 5446 | ||
| 5452 | /* Don't keep undo information around forever. | 5447 | /* Don't keep undo information around forever. |
| 5453 | Do this early on, so it is no problem if the user quits. */ | 5448 | Do this early on, so it is no problem if the user quits. */ |
| @@ -5615,7 +5610,7 @@ See Info node `(elisp)Garbage Collection'. */) | |||
| 5615 | 5610 | ||
| 5616 | UNBLOCK_INPUT; | 5611 | UNBLOCK_INPUT; |
| 5617 | 5612 | ||
| 5618 | CHECK_CONS_LIST (); | 5613 | check_cons_list (); |
| 5619 | 5614 | ||
| 5620 | gc_in_progress = 0; | 5615 | gc_in_progress = 0; |
| 5621 | 5616 | ||
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) | |||
| 2094 | args_left = original_args; | 2094 | args_left = original_args; |
| 2095 | numargs = Flength (args_left); | 2095 | numargs = Flength (args_left); |
| 2096 | 2096 | ||
| 2097 | CHECK_CONS_LIST (); | 2097 | check_cons_list (); |
| 2098 | 2098 | ||
| 2099 | if (XINT (numargs) < XSUBR (fun)->min_args | 2099 | if (XINT (numargs) < XSUBR (fun)->min_args |
| 2100 | || (XSUBR (fun)->max_args >= 0 | 2100 | || (XSUBR (fun)->max_args >= 0 |
| @@ -2222,7 +2222,7 @@ eval_sub (Lisp_Object form) | |||
| 2222 | else | 2222 | else |
| 2223 | xsignal1 (Qinvalid_function, original_fun); | 2223 | xsignal1 (Qinvalid_function, original_fun); |
| 2224 | } | 2224 | } |
| 2225 | CHECK_CONS_LIST (); | 2225 | check_cons_list (); |
| 2226 | 2226 | ||
| 2227 | lisp_eval_depth--; | 2227 | lisp_eval_depth--; |
| 2228 | if (backtrace.debug_on_exit) | 2228 | if (backtrace.debug_on_exit) |
| @@ -2762,7 +2762,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) | |||
| 2762 | if (debug_on_next_call) | 2762 | if (debug_on_next_call) |
| 2763 | do_debug_on_call (Qlambda); | 2763 | do_debug_on_call (Qlambda); |
| 2764 | 2764 | ||
| 2765 | CHECK_CONS_LIST (); | 2765 | check_cons_list (); |
| 2766 | 2766 | ||
| 2767 | original_fun = args[0]; | 2767 | original_fun = args[0]; |
| 2768 | 2768 | ||
| @@ -2871,13 +2871,13 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) | |||
| 2871 | else if (EQ (funcar, Qautoload)) | 2871 | else if (EQ (funcar, Qautoload)) |
| 2872 | { | 2872 | { |
| 2873 | Fautoload_do_load (fun, original_fun, Qnil); | 2873 | Fautoload_do_load (fun, original_fun, Qnil); |
| 2874 | CHECK_CONS_LIST (); | 2874 | check_cons_list (); |
| 2875 | goto retry; | 2875 | goto retry; |
| 2876 | } | 2876 | } |
| 2877 | else | 2877 | else |
| 2878 | xsignal1 (Qinvalid_function, original_fun); | 2878 | xsignal1 (Qinvalid_function, original_fun); |
| 2879 | } | 2879 | } |
| 2880 | CHECK_CONS_LIST (); | 2880 | check_cons_list (); |
| 2881 | lisp_eval_depth--; | 2881 | lisp_eval_depth--; |
| 2882 | if (backtrace.debug_on_exit) | 2882 | if (backtrace.debug_on_exit) |
| 2883 | val = call_debugger (Fcons (Qexit, Fcons (val, Qnil))); | 2883 | 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 <http://www.gnu.org/licenses/>. */ | |||
| 28 | 28 | ||
| 29 | #include <intprops.h> | 29 | #include <intprops.h> |
| 30 | 30 | ||
| 31 | /* Use the configure flag --enable-checking[=LIST] to enable various | ||
| 32 | types of run time checks for Lisp objects. */ | ||
| 33 | |||
| 34 | #ifdef GC_CHECK_CONS_LIST | ||
| 35 | extern void check_cons_list (void); | ||
| 36 | #define CHECK_CONS_LIST() check_cons_list () | ||
| 37 | #else | ||
| 38 | #define CHECK_CONS_LIST() ((void) 0) | ||
| 39 | #endif | ||
| 40 | |||
| 41 | /* Temporarily disable wider-than-pointer integers until they're tested more. | ||
| 42 | Build with CFLAGS='-DWIDE_EMACS_INT' to try them out. */ | ||
| 43 | /* #undef WIDE_EMACS_INT */ | ||
| 44 | |||
| 45 | /* EMACS_INT - signed integer wide enough to hold an Emacs value | 31 | /* EMACS_INT - signed integer wide enough to hold an Emacs value |
| 46 | EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if | 32 | EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if |
| 47 | pI - printf length modifier for EMACS_INT | 33 | pI - printf length modifier for EMACS_INT |
| @@ -642,21 +628,12 @@ struct Lisp_Cons | |||
| 642 | { | 628 | { |
| 643 | /* Please do not use the names of these elements in code other | 629 | /* Please do not use the names of these elements in code other |
| 644 | than the core lisp implementation. Use XCAR and XCDR below. */ | 630 | than the core lisp implementation. Use XCAR and XCDR below. */ |
| 645 | #ifdef HIDE_LISP_IMPLEMENTATION | ||
| 646 | Lisp_Object car_; | ||
| 647 | union | ||
| 648 | { | ||
| 649 | Lisp_Object cdr_; | ||
| 650 | struct Lisp_Cons *chain; | ||
| 651 | } u; | ||
| 652 | #else | ||
| 653 | Lisp_Object car; | 631 | Lisp_Object car; |
| 654 | union | 632 | union |
| 655 | { | 633 | { |
| 656 | Lisp_Object cdr; | 634 | Lisp_Object cdr; |
| 657 | struct Lisp_Cons *chain; | 635 | struct Lisp_Cons *chain; |
| 658 | } u; | 636 | } u; |
| 659 | #endif | ||
| 660 | }; | 637 | }; |
| 661 | 638 | ||
| 662 | /* Take the car or cdr of something known to be a cons cell. */ | 639 | /* Take the car or cdr of something known to be a cons cell. */ |
| @@ -666,13 +643,8 @@ struct Lisp_Cons | |||
| 666 | fields are not accessible as lvalues. (What if we want to switch to | 643 | fields are not accessible as lvalues. (What if we want to switch to |
| 667 | a copying collector someday? Cached cons cell field addresses may be | 644 | a copying collector someday? Cached cons cell field addresses may be |
| 668 | invalidated at arbitrary points.) */ | 645 | invalidated at arbitrary points.) */ |
| 669 | #ifdef HIDE_LISP_IMPLEMENTATION | ||
| 670 | #define XCAR_AS_LVALUE(c) (XCONS ((c))->car_) | ||
| 671 | #define XCDR_AS_LVALUE(c) (XCONS ((c))->u.cdr_) | ||
| 672 | #else | ||
| 673 | #define XCAR_AS_LVALUE(c) (XCONS ((c))->car) | 646 | #define XCAR_AS_LVALUE(c) (XCONS ((c))->car) |
| 674 | #define XCDR_AS_LVALUE(c) (XCONS ((c))->u.cdr) | 647 | #define XCDR_AS_LVALUE(c) (XCONS ((c))->u.cdr) |
| 675 | #endif | ||
| 676 | 648 | ||
| 677 | /* Use these from normal code. */ | 649 | /* Use these from normal code. */ |
| 678 | #define XCAR(c) LISP_MAKE_RVALUE (XCAR_AS_LVALUE (c)) | 650 | #define XCAR(c) LISP_MAKE_RVALUE (XCAR_AS_LVALUE (c)) |
| @@ -1485,23 +1457,13 @@ struct Lisp_Float | |||
| 1485 | { | 1457 | { |
| 1486 | union | 1458 | union |
| 1487 | { | 1459 | { |
| 1488 | #ifdef HIDE_LISP_IMPLEMENTATION | ||
| 1489 | double data_; | ||
| 1490 | #else | ||
| 1491 | double data; | 1460 | double data; |
| 1492 | #endif | ||
| 1493 | struct Lisp_Float *chain; | 1461 | struct Lisp_Float *chain; |
| 1494 | } u; | 1462 | } u; |
| 1495 | }; | 1463 | }; |
| 1496 | 1464 | ||
| 1497 | #ifdef HIDE_LISP_IMPLEMENTATION | 1465 | #define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data : XFLOAT (f)->u.data) |
| 1498 | #define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data_ : XFLOAT (f)->u.data_) | 1466 | #define XFLOAT_INIT(f, n) (XFLOAT (f)->u.data = (n)) |
| 1499 | #else | ||
| 1500 | #define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data : XFLOAT (f)->u.data) | ||
| 1501 | /* This should be used only in alloc.c, which always disables | ||
| 1502 | HIDE_LISP_IMPLEMENTATION. */ | ||
| 1503 | #define XFLOAT_INIT(f,n) (XFLOAT (f)->u.data = (n)) | ||
| 1504 | #endif | ||
| 1505 | 1467 | ||
| 1506 | /* A character, declared with the following typedef, is a member | 1468 | /* A character, declared with the following typedef, is a member |
| 1507 | of some character set associated with the current buffer. */ | 1469 | of some character set associated with the current buffer. */ |
| @@ -2702,6 +2664,11 @@ extern void init_alloc (void); | |||
| 2702 | extern void syms_of_alloc (void); | 2664 | extern void syms_of_alloc (void); |
| 2703 | extern struct buffer * allocate_buffer (void); | 2665 | extern struct buffer * allocate_buffer (void); |
| 2704 | extern int valid_lisp_object_p (Lisp_Object); | 2666 | extern int valid_lisp_object_p (Lisp_Object); |
| 2667 | #ifdef GC_CHECK_CONS_LIST | ||
| 2668 | extern void check_cons_list (void); | ||
| 2669 | #else | ||
| 2670 | #define check_cons_list() ((void) 0) | ||
| 2671 | #endif | ||
| 2705 | 2672 | ||
| 2706 | #ifdef REL_ALLOC | 2673 | #ifdef REL_ALLOC |
| 2707 | /* Defined in ralloc.c */ | 2674 | /* Defined in ralloc.c */ |