| 21 | } |
| 22 | |
| 23 | bool StackHelper::CanStackExpand(int wantBytes) |
| 24 | { |
| 25 | intptr stackBase = 0; |
| 26 | int stackLimit = 0; |
| 27 | BfpThreadResult threadResult; |
| 28 | BfpThreadInfo_GetStackInfo(NULL, &stackBase, &stackLimit, BfpThreadInfoFlags_None, &threadResult); |
| 29 | if (threadResult != BfpThreadResult_Ok) |
| 30 | return true; |
| 31 | |
| 32 | //printf("StackInfo: %p %p %d\n", stackBase, &wantBytes, stackLimit); |
| 33 | |
| 34 | intptr expectedStackPtr = (intptr)(void*)&wantBytes - wantBytes; |
| 35 | int resultSize = (int)(stackBase - expectedStackPtr); |
| 36 | |
| 37 | return resultSize <= stackLimit; |
| 38 | } |
| 39 | |
| 40 | struct StackHelperExecuter |
| 41 | { |
no test coverage detected