diff options
| author | Andreas Schwab | 2012-06-13 15:40:48 +0200 |
|---|---|---|
| committer | Andreas Schwab | 2012-06-13 15:40:48 +0200 |
| commit | 646b5f55dfc28ea37a6605b060f67017cdb1aea8 (patch) | |
| tree | 877cf977e28772931f3d9f3c6cdd05501efeb7c7 /src/alloc.c | |
| parent | ef62b23df5a7007c3d8c74dbca87ba83e9da682e (diff) | |
| download | emacs-646b5f55dfc28ea37a6605b060f67017cdb1aea8.tar.gz emacs-646b5f55dfc28ea37a6605b060f67017cdb1aea8.zip | |
Use a simple struct to implement compile time checks for the Lisp_Object type
* configure.in: Rename --enable-use-lisp-union-type to
--enable-check-lisp-object-type and define CHECK_LISP_OBJECT_TYPE
instead of USE_LISP_UNION_TYPE.
* admin/make-emacs: Rename --union-type to --check-lisp-type. Define
CHECK_LISP_OBJECT_TYPE insted of USE_LISP_UNION_TYPE.
* admin/CPP-DEFINES (DEBUG_LISP_OBJECT_TYPE): Renamed from
USE_LISP_UNION_TYPE.
* src/lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
instead of union.
(XLI, XIL): Define.
(XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG): Use
them.
* src/emacs.c (gdb_use_struct): Renamed from gdb_use_union.
* src/.gdbinit: Check gdb_use_struct instead of gdb_use_union.
* src/alloc.c (widen_to_Lisp_Object): Removed.
(mark_memory): Use XIL instead of widen_to_Lisp_Object.
* src/frame.c (delete_frame): Remove outdated comment.
* src/w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
USE_LISP_UNION_TYPE.
(Fw32_unregister_hot_key): Likewise.
(Fw32_toggle_lock_key): Likewise.
* src/w32menu.c (add_menu_item): Likewise.
(w32_menu_display_help): Use XIL instead of checking
USE_LISP_UNION_TYPE.
* src/w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
(init_heap): Likewise.
* src/w32term.c (w32_read_socket): Update comment.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/alloc.c b/src/alloc.c index 1223f0bc13d..1478ce9ae4e 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1585,21 +1585,6 @@ mark_interval_tree (register INTERVAL tree) | |||
| 1585 | (i) = balance_intervals (i); \ | 1585 | (i) = balance_intervals (i); \ |
| 1586 | } while (0) | 1586 | } while (0) |
| 1587 | 1587 | ||
| 1588 | /* Convert the pointer-sized word P to EMACS_INT while preserving its | ||
| 1589 | type and ptr fields. */ | ||
| 1590 | static Lisp_Object | ||
| 1591 | widen_to_Lisp_Object (void *p) | ||
| 1592 | { | ||
| 1593 | intptr_t i = (intptr_t) p; | ||
| 1594 | #ifdef USE_LISP_UNION_TYPE | ||
| 1595 | Lisp_Object obj; | ||
| 1596 | obj.i = i; | ||
| 1597 | return obj; | ||
| 1598 | #else | ||
| 1599 | return i; | ||
| 1600 | #endif | ||
| 1601 | } | ||
| 1602 | |||
| 1603 | /*********************************************************************** | 1588 | /*********************************************************************** |
| 1604 | String Allocation | 1589 | String Allocation |
| 1605 | ***********************************************************************/ | 1590 | ***********************************************************************/ |
| @@ -4678,7 +4663,7 @@ mark_memory (void *start, void *end) | |||
| 4678 | void *p = *(void **) ((char *) pp + i); | 4663 | void *p = *(void **) ((char *) pp + i); |
| 4679 | mark_maybe_pointer (p); | 4664 | mark_maybe_pointer (p); |
| 4680 | if (POINTERS_MIGHT_HIDE_IN_OBJECTS) | 4665 | if (POINTERS_MIGHT_HIDE_IN_OBJECTS) |
| 4681 | mark_maybe_object (widen_to_Lisp_Object (p)); | 4666 | mark_maybe_object (XIL ((intptr_t) p)); |
| 4682 | } | 4667 | } |
| 4683 | } | 4668 | } |
| 4684 | 4669 | ||