Reorganize sample directory (#34)

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
This commit is contained in:
Jamie Wong
2018-05-08 23:13:38 -07:00
committed by GitHub
parent 2b9f7ffe1b
commit f9032f4100
22 changed files with 2 additions and 4105 deletions

View File

@@ -0,0 +1,52 @@
#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;
}