aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2014-12-18 18:12:01 -0800
committerPaul Eggert2014-12-18 18:12:24 -0800
commitad013ba63134d4fe6470665abf2f9e33a595848a (patch)
tree595bcf2e2228e833fac882aeb60a8793b057f024 /src/alloc.c
parent83299b940dd211f4e142d754b93ea592e9f67974 (diff)
downloademacs-ad013ba63134d4fe6470665abf2f9e33a595848a.tar.gz
emacs-ad013ba63134d4fe6470665abf2f9e33a595848a.zip
Minor cleanups for Lisp objects and symbols
* alloc.c (next_vector, set_next_vector): * lisp.h (lisp_h_INTEGERP, make_number, XFASTINT, make_natnum): (lisp_h_make_number) [USE_LSB_TAG]: Use Lisp_Int0 instead of the mystery constant 0. * alloc.c (mark_object): Always set and use po; that's simpler. (CHECK_LIVE, CHECK_ALLOCATED_AND_LIVE): Properly parenthesize definientia. * bidi.c (bidi_initialize): * buffer.c (init_buffer_once): * nsfns.m (syms_of_nsfns): * nsmenu.m (syms_of_nsmenu): * nsselect.m (syms_of_nsselect): Prefer DEFSYM to defining by hand. * data.c: Fix too-long line. * lisp.h (DECLARE_GDB_SYM): New macro. (DEFINE_GDB_SYMBOL_BEGIN): Use it. (DEFINE_GDB_SYMBOL_BEGIN, DEFINE_GDB_SYMBOL_END) [!MAIN_PROGRAM]: Declare the symbol, so it's visible to everywhere lisp.h is included. Move forward decls as far forward as they can go, to allow future changes to use them.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 43287457c8d..eada96c0c10 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2719,13 +2719,13 @@ DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0,
2719static struct Lisp_Vector * 2719static struct Lisp_Vector *
2720next_vector (struct Lisp_Vector *v) 2720next_vector (struct Lisp_Vector *v)
2721{ 2721{
2722 return XUNTAG (v->contents[0], 0); 2722 return XUNTAG (v->contents[0], Lisp_Int0);
2723} 2723}
2724 2724
2725static void 2725static void
2726set_next_vector (struct Lisp_Vector *v, struct Lisp_Vector *p) 2726set_next_vector (struct Lisp_Vector *v, struct Lisp_Vector *p)
2727{ 2727{
2728 v->contents[0] = make_lisp_ptr (p, 0); 2728 v->contents[0] = make_lisp_ptr (p, Lisp_Int0);
2729} 2729}
2730 2730
2731/* This value is balanced well enough to avoid too much internal overhead 2731/* This value is balanced well enough to avoid too much internal overhead
@@ -6155,15 +6155,16 @@ void
6155mark_object (Lisp_Object arg) 6155mark_object (Lisp_Object arg)
6156{ 6156{
6157 register Lisp_Object obj = arg; 6157 register Lisp_Object obj = arg;
6158#ifdef GC_CHECK_MARKED_OBJECTS
6159 void *po; 6158 void *po;
6159#ifdef GC_CHECK_MARKED_OBJECTS
6160 struct mem_node *m; 6160 struct mem_node *m;
6161#endif 6161#endif
6162 ptrdiff_t cdr_count = 0; 6162 ptrdiff_t cdr_count = 0;
6163 6163
6164 loop: 6164 loop:
6165 6165
6166 if (PURE_POINTER_P (XPNTR (obj))) 6166 po = XPNTR (obj);
6167 if (PURE_POINTER_P (po))
6167 return; 6168 return;
6168 6169
6169 last_marked[last_marked_index++] = obj; 6170 last_marked[last_marked_index++] = obj;
@@ -6175,8 +6176,6 @@ mark_object (Lisp_Object arg)
6175 by ~80%, and requires compilation with GC_MARK_STACK != 0. */ 6176 by ~80%, and requires compilation with GC_MARK_STACK != 0. */
6176#ifdef GC_CHECK_MARKED_OBJECTS 6177#ifdef GC_CHECK_MARKED_OBJECTS
6177 6178
6178 po = (void *) XPNTR (obj);
6179
6180 /* Check that the object pointed to by PO is known to be a Lisp 6179 /* Check that the object pointed to by PO is known to be a Lisp
6181 structure allocated from the heap. */ 6180 structure allocated from the heap. */
6182#define CHECK_ALLOCATED() \ 6181#define CHECK_ALLOCATED() \
@@ -6203,8 +6202,8 @@ mark_object (Lisp_Object arg)
6203 6202
6204#else /* not GC_CHECK_MARKED_OBJECTS */ 6203#else /* not GC_CHECK_MARKED_OBJECTS */
6205 6204
6206#define CHECK_LIVE(LIVEP) (void) 0 6205#define CHECK_LIVE(LIVEP) ((void) 0)
6207#define CHECK_ALLOCATED_AND_LIVE(LIVEP) (void) 0 6206#define CHECK_ALLOCATED_AND_LIVE(LIVEP) ((void) 0)
6208 6207
6209#endif /* not GC_CHECK_MARKED_OBJECTS */ 6208#endif /* not GC_CHECK_MARKED_OBJECTS */
6210 6209