avoid wasted stack space for threads

svn: r3346
This commit is contained in:
Matthew Flatt 2006-06-13 13:54:28 +00:00
parent 76abca0a31
commit 7015529bf5
3 changed files with 12 additions and 16 deletions

View File

@ -4835,11 +4835,13 @@ static int do_generate_closure(mz_jit_state *jitter, void *_data)
code_end = jit_get_ip().ptr;
gdata->code = code;
gdata->tail_code = tail_code;
gdata->max_extra = jitter->max_extra_pushed;
gdata->max_depth = jitter->max_depth;
gdata->code_end = code_end;
if (jitter->retain_start) {
gdata->code = code;
gdata->tail_code = tail_code;
gdata->max_extra = jitter->max_extra_pushed;
gdata->max_depth = jitter->max_depth;
gdata->code_end = code_end;
}
return 1;
}

View File

@ -38,10 +38,6 @@
#endif
#endif
#ifdef memcpy
#undef memcpy
#endif
#ifdef MZ_PRECISE_GC
void *(*scheme_get_external_stack_val)(void);
void (*scheme_set_external_stack_val)(void *);
@ -245,11 +241,6 @@ END_XFORM_SKIP;
/**********************************************************************/
#define memcpy(dd, ss, ll) \
{ stack_val *d, *s; long l; \
l = ll / sizeof(stack_val); d = (stack_val *)dd; s = (stack_val *)ss; \
while (l--) { *(d++) = *(s++);} }
#ifdef MZ_PRECISE_GC
# define GC_VAR_STACK_ARG_DECL , void *gc_var_stack_in
# define GC_VAR_STACK_ARG , __gc_var_stack__

View File

@ -2680,7 +2680,10 @@ static int is_stack_too_shallow2(void)
return s[THREAD_STACK_SPACE];
}
static int is_stack_too_shallow(void)
int scheme_is_stack_too_shallow(void)
/* Make sure this function insn't inlined, mainly because
is_stack_too_shallow2() can get inlined, and it adds a lot
to the stack. */
{
# include "mzstkchk.h"
{
@ -2743,7 +2746,7 @@ Scheme_Object *scheme_thread_w_details(Scheme_Object *thunk,
#ifdef DO_STACK_CHECK
/* Make sure the thread starts out with a reasonable stack size, so
it doesn't thrash right away: */
if (is_stack_too_shallow()) {
if (scheme_is_stack_too_shallow()) {
Scheme_Thread *p = scheme_current_thread;
/* Don't mangle the stack if we're in atomic mode, because that