File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,11 @@ class recurseblock {
67
67
recurseblock ()
68
68
{
69
69
recursioncount++;
70
- if (check_stack_left () < 32768 || recursioncount > 10000 )
70
+ #if !defined(_WIN32) && defined(NO_USE_THREADS)
71
+ if (recursioncount > 500 )
72
+ #else
73
+ if (check_stack_left () < 32768 || recursioncount > 5000 )
74
+ #endif
71
75
asar_throw_error (pass, error_type_fatal, error_id_recursion_limit);
72
76
}
73
77
~recurseblock ()
Original file line number Diff line number Diff line change 3
3
#if defined(_WIN32)
4
4
5
5
#include < windows.h>
6
+ #include < processthreadsapi.h>
6
7
7
8
struct function_pointer_wrapper /* have this struct at global level*/
8
9
{
@@ -84,7 +85,7 @@ bool run_as_thread(functor&& callback) {
84
85
}
85
86
86
87
size_t check_stack_left () {
87
- void * stack_low, * stack_high;
88
+ size_t stack_low, stack_high;
88
89
GetCurrentThreadStackLimits (&stack_low, &stack_high);
89
90
size_t stack_left = (char *)&stack_low - (char *)stack_low;
90
91
return stack_left;
You can’t perform that action at this time.
0 commit comments