MCPcopy Create free account
hub / github.com/beefytech/Beef / CanStackExpand

Method CanStackExpand

BeefySysLib/util/StackHelper.cpp:23–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23bool 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
40struct StackHelperExecuter
41{

Callers 9

DoPopulateTypeMethod · 0.80
CallMethod · 0.80
CreateExpressionMethod · 0.80
CreateStatementMethod · 0.80
ToStringMethod · 0.80

Calls 1

Tested by

no test coverage detected