diff options
| author | Tom Tromey | 2012-08-15 13:01:36 -0600 |
|---|---|---|
| committer | Tom Tromey | 2012-08-15 13:01:36 -0600 |
| commit | 2d525b793f1b0fd2b6f66881310bec8684bceffe (patch) | |
| tree | 932fb8b75974ac4c16ecfc5bc216fe362b0a4d27 /src/lisp.h | |
| parent | 68b32482437e05f0994c4dd0ab5b0c27d39f0f6d (diff) | |
| download | emacs-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/lisp.h')
| -rw-r--r-- | src/lisp.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/lisp.h b/src/lisp.h index 0367d9938b7..a6665320da6 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2715,6 +2715,10 @@ extern void mark_object (Lisp_Object); | |||
| 2715 | #if defined REL_ALLOC && !defined SYSTEM_MALLOC | 2715 | #if defined REL_ALLOC && !defined SYSTEM_MALLOC |
| 2716 | extern void refill_memory_reserve (void); | 2716 | extern void refill_memory_reserve (void); |
| 2717 | #endif | 2717 | #endif |
| 2718 | #if GC_MARK_STACK | ||
| 2719 | extern void mark_stack (char *, char *); | ||
| 2720 | #endif | ||
| 2721 | extern void flush_stack_call_func (void (*func) (void *arg), void *arg); | ||
| 2718 | extern const char *pending_malloc_warning; | 2722 | extern const char *pending_malloc_warning; |
| 2719 | extern Lisp_Object zero_vector; | 2723 | extern Lisp_Object zero_vector; |
| 2720 | extern EMACS_INT consing_since_gc; | 2724 | extern EMACS_INT consing_since_gc; |
| @@ -2902,6 +2906,10 @@ extern Lisp_Object Vautoload_queue; | |||
| 2902 | extern Lisp_Object Vsignaling_function; | 2906 | extern Lisp_Object Vsignaling_function; |
| 2903 | extern Lisp_Object inhibit_lisp_code; | 2907 | extern Lisp_Object inhibit_lisp_code; |
| 2904 | extern int handling_signal; | 2908 | extern int handling_signal; |
| 2909 | #if (GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \ | ||
| 2910 | || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) | ||
| 2911 | extern void mark_catchlist (struct catchtag *); | ||
| 2912 | #endif | ||
| 2905 | /* To run a normal hook, use the appropriate function from the list below. | 2913 | /* To run a normal hook, use the appropriate function from the list below. |
| 2906 | The calling convention: | 2914 | The calling convention: |
| 2907 | 2915 | ||
| @@ -2951,11 +2959,11 @@ extern Lisp_Object safe_call (ptrdiff_t, Lisp_Object, ...); | |||
| 2951 | extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); | 2959 | extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); |
| 2952 | extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object); | 2960 | extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object); |
| 2953 | extern void init_eval (void); | 2961 | extern void init_eval (void); |
| 2954 | #if BYTE_MARK_STACK | ||
| 2955 | extern void mark_backtrace (void); | ||
| 2956 | #endif | ||
| 2957 | extern void syms_of_eval (void); | 2962 | extern void syms_of_eval (void); |
| 2958 | 2963 | ||
| 2964 | /* Defined in thread.c. */ | ||
| 2965 | extern void mark_threads (void); | ||
| 2966 | |||
| 2959 | /* Defined in editfns.c. */ | 2967 | /* Defined in editfns.c. */ |
| 2960 | extern Lisp_Object Qfield; | 2968 | extern Lisp_Object Qfield; |
| 2961 | extern void insert1 (Lisp_Object); | 2969 | extern void insert1 (Lisp_Object); |
| @@ -3211,9 +3219,9 @@ extern int read_bytecode_char (int); | |||
| 3211 | extern Lisp_Object Qbytecode; | 3219 | extern Lisp_Object Qbytecode; |
| 3212 | extern void syms_of_bytecode (void); | 3220 | extern void syms_of_bytecode (void); |
| 3213 | #if BYTE_MARK_STACK | 3221 | #if BYTE_MARK_STACK |
| 3214 | extern void mark_byte_stack (void); | 3222 | extern void mark_byte_stack (struct byte_stack *); |
| 3215 | #endif | 3223 | #endif |
| 3216 | extern void unmark_byte_stack (void); | 3224 | extern void unmark_byte_stack (struct byte_stack *); |
| 3217 | extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, Lisp_Object, | 3225 | extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, Lisp_Object, |
| 3218 | Lisp_Object, ptrdiff_t, Lisp_Object *); | 3226 | Lisp_Object, ptrdiff_t, Lisp_Object *); |
| 3219 | 3227 | ||