Started working on a custom profiler
This commit is contained in:
parent
4f9aaaf8b4
commit
137687e446
8 changed files with 158 additions and 28 deletions
41
src/GC/tests/struct_test.cpp
Normal file
41
src/GC/tests/struct_test.cpp
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#include <iostream>
|
||||
|
||||
#include "heap.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct Node {
|
||||
int value;
|
||||
Node *left;
|
||||
Node *right;
|
||||
};
|
||||
|
||||
int getValue();
|
||||
Node *createNode();
|
||||
void insert();
|
||||
|
||||
int main() {
|
||||
GC::Heap::init();
|
||||
Node *node = static_cast<Node *>(GC::Heap::alloc(sizeof(Node)));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int getValue() {
|
||||
cout << "Enter a value to insert: ";
|
||||
int value;
|
||||
cin >> value;
|
||||
return value;
|
||||
}
|
||||
|
||||
Node *createNode() {
|
||||
Node *node = static_cast<Node *>(GC::Heap::alloc(sizeof(Node)));
|
||||
node->value = getValue();
|
||||
return node;
|
||||
}
|
||||
|
||||
void insert(Node *root) {
|
||||
Node *node = createNode();
|
||||
Node *curr = root;
|
||||
while (curr)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue