From 68b32482437e05f0994c4dd0ab5b0c27d39f0f6d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 15 Aug 2012 12:56:38 -0600 Subject: This introduces a thread-state object and moves various C globals there. It also introduces #defines for these globals to avoid a monster patch. The #defines mean that this patch also has to rename a few fields whose names clash with the defines. There is currently just a single "thread"; so this patch does not impact Emacs behavior in any significant way. --- src/bytecode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bytecode.c') diff --git a/src/bytecode.c b/src/bytecode.c index 5ac8b4fa2bd..019459491e9 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -328,7 +328,7 @@ struct byte_stack done. Signaling an error truncates the list analogous to gcprolist. */ -struct byte_stack *byte_stack_list; +/* struct byte_stack *byte_stack_list; */ /* Mark objects on byte_stack_list. Called during GC. */ -- cgit v1.2.1 From 2d525b793f1b0fd2b6f66881310bec8684bceffe Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 15 Aug 2012 13:01:36 -0600 Subject: 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. --- src/bytecode.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/bytecode.c') 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 #if BYTE_MARK_STACK void -mark_byte_stack (void) +mark_byte_stack (struct byte_stack *stack) { - struct byte_stack *stack; Lisp_Object *obj; - for (stack = byte_stack_list; stack; stack = stack->next) + for (; stack; stack = stack->next) { /* If STACK->top is null here, this means there's an opcode in Fbyte_code that wasn't expected to GC, but did. To find out @@ -364,11 +363,9 @@ mark_byte_stack (void) counters. Called when GC has completed. */ void -unmark_byte_stack (void) +unmark_byte_stack (struct byte_stack *stack) { - struct byte_stack *stack; - - for (stack = byte_stack_list; stack; stack = stack->next) + for (; stack; stack = stack->next) { if (stack->byte_string_start != SDATA (stack->byte_string)) { -- cgit v1.2.1