-
Notifications
You must be signed in to change notification settings - Fork 14
/
IOCPMemoryOverride.h
67 lines (56 loc) · 1.3 KB
/
IOCPMemoryOverride.h
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
64
65
66
67
#pragma once
//预留代码,方便调试内存泄露
template <class Type>
Type* OP_NEW(const char *file, unsigned int line)
{
(void)file;
(void)line;
return new Type;
}
template <class Type, class P1>
Type* OP_NEW_1(const char *file, unsigned int line, const P1 &p1)
{
(void)file;
(void)line;
return new Type(p1);
}
template <class Type, class P1, class P2>
Type* OP_NEW_2(const char *file, unsigned int line, const P1 &p1, const P2 &p2)
{
(void)file;
(void)line;
return new Type(p1, p2);
}
template <class Type, class P1, class P2, class P3>
Type* OP_NEW_3(const char *file, unsigned int line, const P1 &p1, const P2 &p2, const P3 &p3)
{
(void)file;
(void)line;
return new Type(p1, p2, p3);
}
template <class Type, class P1, class P2, class P3, class P4>
Type* OP_NEW_4(const char *file, unsigned int line, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
{
(void)file;
(void)line;
return new Type(p1, p2, p3, p4);
}
template <class Type>
Type* OP_NEW_ARRAY(const int count, const char *file, unsigned int line)
{
(void)file;
(void)line;
return new Type[count];
}
template <class Type>
void OP_DELETE(Type *buff, const char *file, unsigned int line)
{
delete buff;
}
template <class Type>
void OP_DELETE_ARRAY(Type *buff, const char *file, unsigned int line)
{
(void)file;
(void)line;
delete[] buff;
}