-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
55 lines (44 loc) · 1.75 KB
/
main.cpp
File metadata and controls
55 lines (44 loc) · 1.75 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "LinearAllocator.h"
#include "StackAllocator.h"
#include "PoolAllocator.h"
#include "SequentialListAllocator.h"
#include "RBTreeAllocator.h"
#include "SystemAllocator.h"
#include "AllocatorBenchmark.h"
#include <iostream>
#include <Windows.h>
#include "Util.h"
int main() {
//void* p = malloc( 64* 1024*1024 );
//SequentialListAllocator<ALLOC_BUFFER_VMDYNAMIC, ALLOC_PATTERN_FIRST_FIT> sqlAllocator(64 *1024* 1024);
//SystemAllocator sysAllocator;
//AllocatorBenchmark ab;
//std::cout << "\n##########################################";
//std::cout << "\n##########################################";
//std::cout << "\n##########################################\n";
//std::cout << "SEQUENTIAL LIST ALLOCATOR BENCHMARK\n";
//ab.Benchmark(&sqlAllocator, AllocatorBenchmark::ALLOC_SEQ | AllocatorBenchmark::FREE_FIFO |
// AllocatorBenchmark::FREE_LIFO | AllocatorBenchmark::FREE_RAND);
//std::cout << "\n##########################################";
//std::cout << "\n##########################################";
//std::cout << "\n##########################################";
//std::cout << "SYSTEM ALLOCATOR BENCHMARK\n";
//ab.Benchmark(&sysAllocator, AllocatorBenchmark::ALLOC_SEQ | AllocatorBenchmark::ALLOC_SEQ |
// AllocatorBenchmark::FREE_FIFO | AllocatorBenchmark::FREE_LIFO | AllocatorBenchmark::FREE_RAND);
//GPCL::DiscreteMultiRBTree<int> tree;
//tree.Insert(30);
//tree.Insert(20);
//tree.Insert(40);
//tree.Insert(50);
//tree.Insert(35);
//tree.Layout();
//tree.Delete(40);
//tree.Layout();
RBTreeAllocator alloc(64*1024);
alloc.Layout();
void* ptr1 = alloc.Alloc(64, 8);
alloc.Layout();
alloc.Free(ptr1);
alloc.Layout();
return 0;
}