-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.cpp
63 lines (63 loc) · 1.08 KB
/
Test.cpp
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
56
57
58
59
60
61
62
63
//#include "ConcurrentAlloc.h"
//
//void MultiThreadAlloc1()
//{
// for (size_t i = 0; i < 5; ++i)
// {
// void* ptr = ConcurrentAlloc(6);
// }
//}
//
//void MultiThreadAlloc2()
//{
// for (size_t i = 0; i < 5; ++i)
// {
// void* ptr = ConcurrentAlloc(7);
// }
//}
//
//void TLSTest()
//{
// std::thread t1(MultiThreadAlloc1);
// t1.join();
//
// std::thread t2(MultiThreadAlloc2);
// t2.join();
//}
//void TestConcurrentAlloc2()
//{
// for (size_t i = 0; i < 1024; ++i)
// {
// void* p1 = ConcurrentAlloc(6);
// cout << p1 << endl;
// }
//
// void* p2 = ConcurrentAlloc(8);
// cout << p2 << endl;
//}
//void TestMultiThread()
//{
// std::thread t1(MultiThreadAlloc1);
// std::thread t2(MultiThreadAlloc2);
//
// t1.join();
// t2.join();
//}
//void TestBigAlloc()
//{
// void* p1 = ConcurrentAlloc(257 * 1024);
// ConcurrentFree(p1);
//
// void* p2 = ConcurrentAlloc(129 * 8 * 1024);
// ConcurrentFree(p2);
//}
//
//int main()
//{
// TLSTest();
// TestConcurrentAlloc2();
// TestMultiThread();
// TestBigAlloc();
// //cout << sizeof Span <<" " << sizeof ThreadCache; //64 4992
// return 0;
//}