Back to index

plt-scheme  4.2.1
mzstkchk.h
Go to the documentation of this file.
00001 #ifndef SCHEME_CURRENT_PROCESS
00002 # define SCHEME_CURRENT_PROCESS scheme_current_thread
00003 #endif
00004 #ifndef SCHEME_STACK_BOUNDARY
00005 # define SCHEME_STACK_BOUNDARY scheme_stack_boundary
00006 #endif
00007 
00008 #ifdef SPAWN_NEW_STACK
00009   unsigned long _stk_pos;
00010 
00011   _stk_pos = (unsigned long)&_stk_pos;
00012   if (STK_COMP(_stk_pos, (unsigned long)SCHEME_CURRENT_PROCESS->stack_end)
00013       && !scheme_no_stack_overflow)
00014 #else
00015 # ifdef USE_STACKAVAIL
00016   if ((stackavail() < STACK_SAFETY_MARGIN) && !scheme_no_stack_overflow)
00017 # endif
00018 # if defined(UNIX_FIND_STACK_BOUNDS) || defined(WINDOWS_FIND_STACK_BOUNDS) \
00019      || defined(MACOS_FIND_STACK_BOUNDS) || defined(ASSUME_FIXED_STACK_SIZE) \
00020      || defined(BEOS_FIND_STACK_BOUNDS) || defined(OSKIT_FIXED_STACK_BOUNDS) \
00021      || defined(PALM_FIND_STACK_BOUNDS)
00022   unsigned long _stk_pos;
00023 
00024   _stk_pos = (unsigned long)&_stk_pos;
00025 
00026   if (STK_COMP(_stk_pos, SCHEME_STACK_BOUNDARY)
00027       && !scheme_no_stack_overflow)
00028 # endif
00029 #endif
00030 
00031 #undef SCHEME_CURRENT_PROCESS
00032 #undef SCHEME_STACK_BOUNDARY