MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / main

Function main

samples/memory_leak_test.cpp:57–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55
56
57int main(int /*argc*/, char * /*argv*/[]) {
58
59 test myChai;
60
61
62 std::string command = "";
63
64 //
65 // this loop increases memory usage, if RunFile is not called (just hitting enter)
66 // as soon RunFile gets called, memory will be freed.
67 //
68 // scenario1 - RunFile gets called every Loop: memory usage does not change
69 // scenario2 - RunFile gets never called (just hitting enter): memory usage increases every loop
70 // scenario3 - RunFile gets in changing intervals: memory usage goes up and down, but never as
71 // low as in case 1 scenario3 :
72
73 while(command != "quit")
74 {
75 for(int i = 1; i < 200; i++)
76 myChai.ResetState();
77
78 if(command == "runfile")
79 myChai.RunFile("Test.chai");
80
81 command = get_next_command();
82 }
83}

Callers

nothing calls this directly

Calls 3

ResetStateMethod · 0.80
RunFileMethod · 0.80
get_next_commandFunction · 0.70

Tested by

no test coverage detected