* misc.c (GC_call_with_gc_active): Add GC_noop1 call between "fn" call
and "return" statement to discourage the compiler from treating the
function call as a tail one (thus ensuring "stackbottom" COOLER_THAN
any stack pointer value obtained inside "fn").
* pthread_support.c (GC_call_with_gc_active): Likewise.
* win32_threads.c (GC_call_with_gc_active): Likewise.
if (GC_blocked_sp == NULL) {
/* We are not inside GC_do_blocking() - do nothing more. */
- return fn(client_data);
+ client_data = fn(client_data);
+ /* Prevent treating the above as a tail call. */
+ GC_noop1((word)(&stacksect));
+ return client_data; /* result */
}
/* Setup new "stack section". */
if (!me->thread_blocked) {
/* We are not inside GC_do_blocking() - do nothing more. */
UNLOCK();
- return fn(client_data);
+ client_data = fn(client_data);
+ /* Prevent treating the above as a tail call. */
+ GC_noop1((word)(&stacksect));
+ return client_data; /* result */
}
/* Setup new "stack section". */
if (me -> thread_blocked_sp == NULL) {
/* We are not inside GC_do_blocking() - do nothing more. */
UNLOCK();
- return fn(client_data);
+ client_data = fn(client_data);
+ /* Prevent treating the above as a tail call. */
+ GC_noop1((word)(&stacksect));
+ return client_data; /* result */
}
/* Setup new "stack section". */