aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index c4db234aba5..6e4cfa07fa0 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1582,6 +1582,21 @@ make_number (EMACS_INT n)
1582} 1582}
1583#endif 1583#endif
1584 1584
1585/* Convert the pointer-sized word P to EMACS_INT while preserving its
1586 type and ptr fields. */
1587static Lisp_Object
1588widen_to_Lisp_Object (void *p)
1589{
1590 intptr_t i = (intptr_t) p;
1591#ifdef USE_LISP_UNION_TYPE
1592 Lisp_Object obj;
1593 obj.i = i;
1594 return obj;
1595#else
1596 return i;
1597#endif
1598}
1599
1585/*********************************************************************** 1600/***********************************************************************
1586 String Allocation 1601 String Allocation
1587 ***********************************************************************/ 1602 ***********************************************************************/
@@ -4294,7 +4309,19 @@ mark_memory (void *start, void *end)
4294 4309
4295 for (pp = start; (void *) pp < end; pp++) 4310 for (pp = start; (void *) pp < end; pp++)
4296 for (i = 0; i < sizeof *pp; i += GC_POINTER_ALIGNMENT) 4311 for (i = 0; i < sizeof *pp; i += GC_POINTER_ALIGNMENT)
4297 mark_maybe_pointer (*(void **) ((char *) pp + i)); 4312 {
4313 void *w = *(void **) ((char *) pp + i);
4314 mark_maybe_pointer (w);
4315
4316#ifdef USE_LSB_TAG
4317 /* A host where a Lisp_Object is wider than a pointer might
4318 allocate a Lisp_Object in non-adjacent halves. If
4319 USE_LSB_TAG, the bottom half is not a valid pointer, so
4320 widen it to to a Lisp_Object and check it that way. */
4321 if (sizeof w < sizeof (Lisp_Object))
4322 mark_maybe_object (widen_to_Lisp_Object (w));
4323#endif
4324 }
4298} 4325}
4299 4326
4300/* setjmp will work with GCC unless NON_SAVING_SETJMP is defined in 4327/* setjmp will work with GCC unless NON_SAVING_SETJMP is defined in