avoid wasted stack space for threads
svn: r3346
This commit is contained in:
parent
76abca0a31
commit
7015529bf5
|
@ -4835,11 +4835,13 @@ static int do_generate_closure(mz_jit_state *jitter, void *_data)
|
||||||
|
|
||||||
code_end = jit_get_ip().ptr;
|
code_end = jit_get_ip().ptr;
|
||||||
|
|
||||||
gdata->code = code;
|
if (jitter->retain_start) {
|
||||||
gdata->tail_code = tail_code;
|
gdata->code = code;
|
||||||
gdata->max_extra = jitter->max_extra_pushed;
|
gdata->tail_code = tail_code;
|
||||||
gdata->max_depth = jitter->max_depth;
|
gdata->max_extra = jitter->max_extra_pushed;
|
||||||
gdata->code_end = code_end;
|
gdata->max_depth = jitter->max_depth;
|
||||||
|
gdata->code_end = code_end;
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,10 +38,6 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef memcpy
|
|
||||||
#undef memcpy
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MZ_PRECISE_GC
|
#ifdef MZ_PRECISE_GC
|
||||||
void *(*scheme_get_external_stack_val)(void);
|
void *(*scheme_get_external_stack_val)(void);
|
||||||
void (*scheme_set_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
|
#ifdef MZ_PRECISE_GC
|
||||||
# define GC_VAR_STACK_ARG_DECL , void *gc_var_stack_in
|
# define GC_VAR_STACK_ARG_DECL , void *gc_var_stack_in
|
||||||
# define GC_VAR_STACK_ARG , __gc_var_stack__
|
# define GC_VAR_STACK_ARG , __gc_var_stack__
|
||||||
|
|
|
@ -2680,7 +2680,10 @@ static int is_stack_too_shallow2(void)
|
||||||
return s[THREAD_STACK_SPACE];
|
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"
|
# include "mzstkchk.h"
|
||||||
{
|
{
|
||||||
|
@ -2743,7 +2746,7 @@ Scheme_Object *scheme_thread_w_details(Scheme_Object *thunk,
|
||||||
#ifdef DO_STACK_CHECK
|
#ifdef DO_STACK_CHECK
|
||||||
/* Make sure the thread starts out with a reasonable stack size, so
|
/* Make sure the thread starts out with a reasonable stack size, so
|
||||||
it doesn't thrash right away: */
|
it doesn't thrash right away: */
|
||||||
if (is_stack_too_shallow()) {
|
if (scheme_is_stack_too_shallow()) {
|
||||||
Scheme_Thread *p = scheme_current_thread;
|
Scheme_Thread *p = scheme_current_thread;
|
||||||
|
|
||||||
/* Don't mangle the stack if we're in atomic mode, because that
|
/* Don't mangle the stack if we're in atomic mode, because that
|
||||||
|
|
Loading…
Reference in New Issue
Block a user