aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2016-01-10 21:41:59 -0800
committerPaul Eggert2016-01-10 21:46:37 -0800
commiteef6784ea4932adbce24030b171df6c09bb4736a (patch)
treed48330d096cc176a5b243a4a93746de3262d3161 /src/alloc.c
parent552694a2653b4f9cde515139d01793a5a0e964b7 (diff)
downloademacs-eef6784ea4932adbce24030b171df6c09bb4736a.tar.gz
emacs-eef6784ea4932adbce24030b171df6c09bb4736a.zip
Simplify HAVE_MODULES use in mark_maybe_pointer
* src/alloc.c (HAVE_MODULES): Now a constant 0 if not defined, so that later code can use 'if' rather than '#ifdef'. (mark_maybe_pointer): Simplify based on HAVE_MODULES now always working.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 9d876a51469..8ceacfe8ead 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3732,7 +3732,7 @@ make_event_array (ptrdiff_t nargs, Lisp_Object *args)
3732#ifdef HAVE_MODULES 3732#ifdef HAVE_MODULES
3733/* Create a new module user ptr object. */ 3733/* Create a new module user ptr object. */
3734Lisp_Object 3734Lisp_Object
3735make_user_ptr (void (*finalizer) (void*), void *p) 3735make_user_ptr (void (*finalizer) (void *), void *p)
3736{ 3736{
3737 Lisp_Object obj; 3737 Lisp_Object obj;
3738 struct Lisp_User_Ptr *uptr; 3738 struct Lisp_User_Ptr *uptr;
@@ -4594,6 +4594,10 @@ maybe_lisp_pointer (void *p)
4594 return (uintptr_t) p % GCALIGNMENT == 0; 4594 return (uintptr_t) p % GCALIGNMENT == 0;
4595} 4595}
4596 4596
4597#ifndef HAVE_MODULES
4598enum { HAVE_MODULES = false };
4599#endif
4600
4597/* If P points to Lisp data, mark that as live if it isn't already 4601/* If P points to Lisp data, mark that as live if it isn't already
4598 marked. */ 4602 marked. */
4599 4603
@@ -4607,21 +4611,17 @@ mark_maybe_pointer (void *p)
4607 VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); 4611 VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p));
4608#endif 4612#endif
4609 4613
4610 if ( 4614 if (sizeof (Lisp_Object) == sizeof (void *) || !HAVE_MODULES)
4611#ifdef HAVE_MODULES
4612 sizeof (Lisp_Object) == sizeof (void *)
4613#else
4614 true
4615#endif
4616 )
4617 { 4615 {
4618 if (!maybe_lisp_pointer (p)) 4616 if (!maybe_lisp_pointer (p))
4619 return; 4617 return;
4620 } 4618 }
4621 else 4619 else
4622 /* For the wide-int case, we also have to accept emacs_value "tagged 4620 {
4623 pointers", which can be generated by emacs-module.c's value_to_lisp. */ 4621 /* For the wide-int case, also mark emacs_value tagged pointers,
4624 p = (void*)((uintptr_t) p & ~(GCALIGNMENT - 1)); 4622 which can be generated by emacs-module.c's value_to_lisp. */
4623 p = (void *) ((uintptr_t) p & ~(GCALIGNMENT - 1));
4624 }
4625 4625
4626 m = mem_find (p); 4626 m = mem_find (p);
4627 if (m != MEM_NIL) 4627 if (m != MEM_NIL)
@@ -4729,7 +4729,7 @@ mark_memory (void *start, void *end)
4729 away. The only reference to the life string is through the 4729 away. The only reference to the life string is through the
4730 pointer `s'. */ 4730 pointer `s'. */
4731 4731
4732 for (pp = start; (void*)pp < end; pp = pp + GC_POINTER_ALIGNMENT) 4732 for (pp = start; (void *) pp < end; pp += GC_POINTER_ALIGNMENT)
4733 { 4733 {
4734 mark_maybe_pointer (*(void **) pp); 4734 mark_maybe_pointer (*(void **) pp);
4735 mark_maybe_object (*(Lisp_Object *) pp); 4735 mark_maybe_object (*(Lisp_Object *) pp);