File: function_indirect_recursive.cpp

package info (click to toggle)
android-platform-system-extras 8.1.0%2Br23-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 12,020 kB
  • sloc: cpp: 38,496; ansic: 16,188; python: 4,363; sh: 4,026; java: 584; xml: 367; asm: 169; makefile: 20
file content (26 lines) | stat: -rw-r--r-- 456 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
constexpr int LOOP_COUNT = 5000000;

void FunctionRecursiveTwo(int loop);

void FunctionRecursiveOne(int loop) {
  for (volatile int i = 0; i < LOOP_COUNT; ++i) {
  }
  if (loop >= 0) {
    FunctionRecursiveTwo(loop);
  }
}

void FunctionRecursiveTwo(int loop) {
  for (volatile int i = 0; i < LOOP_COUNT; ++i) {
  }
  if (loop > 0) {
    FunctionRecursiveOne(loop - 1);
  }
}

int main() {
  while (true) {
    FunctionRecursiveOne(10);
  }
  return 0;
}