| 457 |
#ifdef _WIN32 |
#ifdef _WIN32 |
| 458 |
#include <malloc.h> |
#include <malloc.h> |
| 459 |
|
|
| 460 |
static void SLJIT_CALL sljit_touch_stack(sljit_w local_size) |
static void SLJIT_CALL sljit_grow_stack(sljit_w local_size) |
| 461 |
{ |
{ |
| 462 |
/* Workaround for calling _chkstk. */ |
/* Workaround for calling the internal _chkstk() function on Windows. |
| 463 |
|
This function touches all 4k pages belongs to the requested stack space, |
| 464 |
|
which size is passed in local_size. This is necessary on Windows where |
| 465 |
|
the stack can only grow in 4k steps. However, this function just burn |
| 466 |
|
CPU cycles if the stack is large enough, but you don't know it in advance. |
| 467 |
|
I think this is a bad design even if it has some reasons. */ |
| 468 |
alloca(local_size); |
alloca(local_size); |
| 469 |
} |
} |
| 470 |
|
|
| 471 |
#endif |
#endif |
| 472 |
|
|
| 473 |
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) |
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) |