summaryrefslogtreecommitdiff
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-09-05 12:13:32 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-09-05 12:15:14 -0700
commit6cf62141c4467314f67c2ef75a4bf94d41ff050f (patch)
tree15e690c820576893cb9ca5d3f2dd1455dd3f0520 /src/lisp.h
parent940ea1549117f56642fd6830bdbccf8865a932bb (diff)
downloademacs-6cf62141c4467314f67c2ef75a4bf94d41ff050f.tar.gz
Reinstall recent GC-related changes
The report that they broke macOS was a false alarm, as the previous commit was also broken (Bug#43152#62). * src/alloc.c (live_string_holding, live_cons_holding) (live_symbol_holding): Count only pointers that point to a struct component, or are a tagged pointer to the start of the struct. Exception: for non-bool-vector pseudovectors, count any pointer past the header, since it’s too much of a pain to write code for every pseudovector. (live_float_holding, live_vector_pointer): New functions, which are similar about counting pointers. (live_float_p, live_large_vector_holding) (live_small_vector_pointer, mark_maybe_pointer): Use them. (mark_maybe_object, mark_maybe_objects): Remove, and remove all callers; mark_maybe_pointer now suffices. (mark_objects): New function. * src/alloc.c (mark_vectorlike, mark_face_cache): * src/eval.c (mark_specpdl): * src/fringe.c (mark_fringe_data): * src/keyboard.c (mark_kboards): Simplify by using mark_objects. * src/lisp.h (SAFE_ALLOCA_LISP_EXTRA): Clear any Lisp_Object arrays large enough to not fit into the stack, so that GC need not worry about whether they contain objects.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lisp.h b/src/lisp.h
index bc069ef2774..88e69b9061d 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3756,12 +3756,12 @@ extern AVOID memory_full (size_t);
extern AVOID buffer_memory_full (ptrdiff_t);
extern bool survives_gc_p (Lisp_Object);
extern void mark_object (Lisp_Object);
+extern void mark_objects (Lisp_Object *, ptrdiff_t);
#if defined REL_ALLOC && !defined SYSTEM_MALLOC && !defined HYBRID_MALLOC
extern void refill_memory_reserve (void);
#endif
extern void alloc_unexec_pre (void);
extern void alloc_unexec_post (void);
-extern void mark_maybe_objects (Lisp_Object const *, ptrdiff_t);
extern void mark_stack (char const *, char const *);
extern void flush_stack_call_func1 (void (*func) (void *arg), void *arg);
@@ -4873,7 +4873,10 @@ safe_free_unbind_to (ptrdiff_t count, ptrdiff_t sa_count, Lisp_Object val)
(buf) = AVAIL_ALLOCA (alloca_nbytes); \
else \
{ \
- (buf) = xmalloc (alloca_nbytes); \
+ /* Although only the first nelt words need clearing, \
+ typically EXTRA is 0 or small so just use xzalloc; \
+ this is simpler and often faster. */ \
+ (buf) = xzalloc (alloca_nbytes); \
record_unwind_protect_array (buf, nelt); \
} \
} while (false)