This should help keep things organized as speedscope supports more languages & more formats Test Plan: Try importing from every single file type, see that the link to load the example profile still works
53 lines
661 B
C++
53 lines
661 B
C++
#include <cstdlib>
|
|
using namespace std;
|
|
|
|
void leakMemory() {
|
|
for (int i = 0; i < 100; i++) {
|
|
malloc(1024);
|
|
}
|
|
}
|
|
|
|
void alpha() {
|
|
leakMemory();
|
|
int z = 3;
|
|
for (int i = 0; i < 100000; i++) {
|
|
z *= 3;
|
|
}
|
|
}
|
|
|
|
void beta() {
|
|
leakMemory();
|
|
int z = 3;
|
|
for (int i = 0; i < 100000; i++) {
|
|
z *= 3;
|
|
}
|
|
}
|
|
|
|
void delta() {
|
|
leakMemory();
|
|
int z = 3;
|
|
for (int i = 0; i < 100000; i++) {
|
|
z *= 3;
|
|
}
|
|
alpha();
|
|
beta();
|
|
}
|
|
|
|
void gamma() {
|
|
leakMemory();
|
|
int z = 3;
|
|
for (int i = 0; i < 100000; i++) {
|
|
z *= 3;
|
|
}
|
|
}
|
|
|
|
int main(int argc, char* argv[]) {
|
|
while (true) {
|
|
alpha();
|
|
beta();
|
|
delta();
|
|
gamma();
|
|
}
|
|
return 0;
|
|
}
|