aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorTom Tromey2012-08-15 13:01:36 -0600
committerTom Tromey2012-08-15 13:01:36 -0600
commit2d525b793f1b0fd2b6f66881310bec8684bceffe (patch)
tree932fb8b75974ac4c16ecfc5bc216fe362b0a4d27 /src/bytecode.c
parent68b32482437e05f0994c4dd0ab5b0c27d39f0f6d (diff)
downloademacs-2d525b793f1b0fd2b6f66881310bec8684bceffe.tar.gz
emacs-2d525b793f1b0fd2b6f66881310bec8684bceffe.zip
This parameterizes the GC a bit to make it thread-ready.
The basic idea is that whenever a thread "exits lisp" -- that is, releases the global lock in favor of another thread -- it must save its stack boundaries in the thread object. This way the boundaries are always available for marking. This is the purpose of flush_stack_call_func. I haven't tested this under all the possible GC configurations. There is a new FIXME in a spot that i didn't convert. Arguably all_threads should go in the previous patch.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 019459491e9..d61e37d7886 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -335,12 +335,11 @@ struct byte_stack
335 335
336#if BYTE_MARK_STACK 336#if BYTE_MARK_STACK
337void 337void
338mark_byte_stack (void) 338mark_byte_stack (struct byte_stack *stack)
339{ 339{
340 struct byte_stack *stack;
341 Lisp_Object *obj; 340 Lisp_Object *obj;
342 341
343 for (stack = byte_stack_list; stack; stack = stack->next) 342 for (; stack; stack = stack->next)
344 { 343 {
345 /* If STACK->top is null here, this means there's an opcode in 344 /* If STACK->top is null here, this means there's an opcode in
346 Fbyte_code that wasn't expected to GC, but did. To find out 345 Fbyte_code that wasn't expected to GC, but did. To find out
@@ -364,11 +363,9 @@ mark_byte_stack (void)
364 counters. Called when GC has completed. */ 363 counters. Called when GC has completed. */
365 364
366void 365void
367unmark_byte_stack (void) 366unmark_byte_stack (struct byte_stack *stack)
368{ 367{
369 struct byte_stack *stack; 368 for (; stack; stack = stack->next)
370
371 for (stack = byte_stack_list; stack; stack = stack->next)
372 { 369 {
373 if (stack->byte_string_start != SDATA (stack->byte_string)) 370 if (stack->byte_string_start != SDATA (stack->byte_string))
374 { 371 {