(The growth observed in applications that implement things like weak
hash tables and iterate over the members marking entries using the
supplied GC_MARK_AND_PUSH macro.)
When overflow is signaled, only set GC_mark_stack_too_small if we
are using the global mark stack. In parallel mode, local mark stack
is used, so the global mark stack is grown by GC_return_mark_stack
mainly.
* mark.c (GC_signal_mark_stack_overflow): Do not set
GC_mark_stack_too_small if GC_parallel.
GC_INNER mse * GC_signal_mark_stack_overflow(mse *msp)
{
GC_mark_state = MS_INVALID;
- GC_mark_stack_too_small = TRUE;
+# ifdef PARALLEL_MARK
+ /* We are using a local_mark_stack in parallel mode, so */
+ /* do not signal the global mark stack to be resized. */
+ /* That will be done if required in GC_return_mark_stack. */
+ if (!GC_parallel)
+ GC_mark_stack_too_small = TRUE;
+# else
+ GC_mark_stack_too_small = TRUE;
+# endif
GC_COND_LOG_PRINTF("Mark stack overflow; current size = %lu entries\n",
(unsigned long)GC_mark_stack_size);
return(msp - GC_MARK_STACK_DISCARDS);