-
- return;
-}
-
-#ifdef CONTROL_STACKS
-/* Scavenge the thread stack conservative roots. */
-static void
-scavenge_thread_stacks(void)
-{
- lispobj thread_stacks = SymbolValue(CONTROL_STACKS);
- int type = TypeOf(thread_stacks);
-
- if (LowtagOf(thread_stacks) == type_OtherPointer) {
- struct vector *vector = (struct vector *) PTR(thread_stacks);
- int length, i;
- if (TypeOf(vector->header) != type_SimpleVector)
- return;
- length = fixnum_value(vector->length);
- for (i = 0; i < length; i++) {
- lispobj stack_obj = vector->data[i];
- if (LowtagOf(stack_obj) == type_OtherPointer) {
- struct vector *stack = (struct vector *) PTR(stack_obj);
- int vector_length;
- if (TypeOf(stack->header) !=
- type_SimpleArrayUnsignedByte32) {
- return;
- }
- vector_length = fixnum_value(stack->length);
- if ((gencgc_verbose > 1) && (vector_length <= 0))
- FSHOW((stderr,
- "/weird? control stack vector length %d\n",
- vector_length));
- if (vector_length > 0) {
- lispobj *stack_pointer = (lispobj*)stack->data[0];
- if ((stack_pointer < (lispobj *)CONTROL_STACK_START) ||
- (stack_pointer > (lispobj *)CONTROL_STACK_END))
- lose("invalid stack pointer %x",
- (unsigned)stack_pointer);
- if ((stack_pointer > (lispobj *)CONTROL_STACK_START) &&
- (stack_pointer < (lispobj *)CONTROL_STACK_END)) {
- /* FIXME: Ick!
- * (1) hardwired word length = 4; and as usual,
- * when fixing this, check for other places
- * with the same problem
- * (2) calling it 'length' suggests bytes;
- * perhaps 'size' instead? */
- unsigned int length = ((unsigned)CONTROL_STACK_END -
- (unsigned)stack_pointer) / 4;
- int j;
- if (length >= vector_length) {
- lose("invalid stack size %d >= vector length %d",
- length,
- vector_length);
- }
- if (gencgc_verbose > 1) {
- FSHOW((stderr,
- "scavenging %d words of control stack %d of length %d words.\n",
- length, i, vector_length));
- }
- for (j = 0; j < length; j++) {
- preserve_pointer((void *)stack->data[1+j]);
- }
- }
- }
- }
- }
- }