-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
61 lines (46 loc) · 1.22 KB
/
main.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
#include <iostream>
#include <vector>
// NOTE: 123123
// ISSUE: 123123
// TODO: 123123
// FIXME: 12323
using std::cout;
using std::endl;
//inline void* operator new(size_t size)
//{
// void* ptr = malloc(size);
// cout << "\n [global operator new] size = " << size << " ptr = " << ptr << endl;
// cout << endl;
// return ptr;
//}
//inline void* operator new[](size_t size)
//{
// void * ptr = malloc(size);
// cout << "\n [global operator new[]] size = " << size << " ptr = " << ptr << endl;
// cout << endl;
// return ptr;
//}
// 要加上第二参数才会调用到自定义的 operator delete
//inline void operator delete(void* ptr, size_t)
//{
// cout << "[global operator delete] ptr = " << ptr << endl;
// free(ptr);
//}
//
//inline void operator delete[](void* ptr, size_t)
//{
// cout << "[global operator delete[]] ptr = " << ptr << endl;
// free(ptr);
//}
#include"utility/bitset.h"
#include"utility/bloomfilter.h"
#include <memory>
#include <unordered_map>
#include "MYSTL/hash_map.h"
int main()
{
std::shared_ptr<int[]> sp(new int[10]);
std::cout << sizeof(std::unordered_map<int, int>) << std::endl;
std::cout << sizeof(MYSTL::hash_map<int, int>) << std::endl;
return 0;
}