MCPcopy Create free account
hub / github.com/Samsung/UTopia / increaseStackSize

Function increaseStackSize

tools/ut_analyzer/main.cpp:10–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8using namespace ftg;
9
10void increaseStackSize() {
11
12 const unsigned long long MAX = 100 * 1024 * 1024;
13 struct rlimit Limit;
14
15 if (getrlimit(RLIMIT_STACK, &Limit) == 0) {
16 if (MAX < Limit.rlim_cur) {
17 llvm::outs() << "[I] Default stack size is enough.\n";
18 return;
19 }
20 }
21
22 Limit.rlim_cur = MAX;
23 Limit.rlim_max = MAX;
24 if (setrlimit(RLIMIT_STACK, &Limit) != 0) {
25 llvm::outs() << "[W] Unable to increase stack size.\n";
26 return;
27 }
28
29 if (getrlimit(RLIMIT_STACK, &Limit) == 0) {
30 llvm::outs() << "[I] Stack size increased to "
31 << Limit.rlim_cur / 1024 / 1024 << " MB.\n";
32 }
33}
34
35int main(int argc, const char **argv) {
36 llvm::cl::ResetCommandLineParser();

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected