|
1 | | -#ifdef DEBUG_MEMORY_NAME |
2 | | -// new(0) |
3 | | -template <class T> |
4 | | -IC T* xr_new() |
5 | | -{ |
6 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T), typeid(T).name()); |
7 | | - return new (ptr)T(); |
8 | | -} |
9 | | -// new(1) |
10 | | -template <class T, class P1> |
11 | | -IC T* xr_new(const P1& p1) |
12 | | -{ |
13 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T), typeid(T).name()); |
14 | | - return new (ptr)T(p1); |
15 | | -} |
16 | | -// new(2) |
17 | | -template <class T, class P1, class P2> |
18 | | -IC T* xr_new(const P1& p1, const P2& p2) |
19 | | -{ |
20 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T), typeid(T).name()); |
21 | | - return new (ptr)T(p1, p2); |
22 | | -} |
23 | | -// new(3) |
24 | | -template <class T, class P1, class P2, class P3> |
25 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3) |
26 | | -{ |
27 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T), typeid(T).name()); |
28 | | - return new (ptr)T(p1, p2, p3); |
29 | | -} |
30 | | -// new(4) |
31 | | -template <class T, class P1, class P2, class P3, class P4> |
32 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4) |
33 | | -{ |
34 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T), typeid(T).name()); |
35 | | - return new (ptr)T(p1, p2, p3, p4); |
36 | | -} |
37 | | -// new(5) |
38 | | -template <class T, class P1, class P2, class P3, class P4, class P5> |
39 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5) |
40 | | -{ |
41 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T), typeid(T).name()); |
42 | | - return new (ptr)T(p1, p2, p3, p4, p5); |
43 | | -} |
44 | | -// new(6) |
45 | | -template <class T, class P1, class P2, class P3, class P4, class P5, class P6> |
46 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6) |
47 | | -{ |
48 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T), typeid(T).name()); |
49 | | - return new (ptr)T(p1, p2, p3, p4, p5, p6); |
50 | | -} |
51 | | -// new(7) |
52 | | -template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7> |
53 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6, const P7& p7) |
54 | | -{ |
55 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T), typeid(T).name()); |
56 | | - return new (ptr)T(p1, p2, p3, p4, p5, p6, p7); |
57 | | -} |
58 | | -// new(8) |
59 | | -template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8> |
60 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6, const P7& p7, const P8& p8) |
61 | | -{ |
62 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T), typeid(T).name()); |
63 | | - return new (ptr)T(p1, p2, p3, p4, p5, p6, p7, p8); |
64 | | -} |
65 | | -// new(9) |
66 | | -template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9> |
67 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6, const P7& p7, const P8& p8, const P8& p9) |
68 | | -{ |
69 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T), typeid(T).name()); |
70 | | - return new (ptr)T(p1, p2, p3, p4, p5, p6, p7, p8, p9); |
71 | | -} |
72 | | -#else // DEBUG_MEMORY_NAME |
73 | | -// new(0) |
74 | | -template <class T> |
75 | | -IC T* xr_new() |
76 | | -{ |
77 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T)); |
78 | | - return new (ptr)T(); |
79 | | -} |
80 | | -// new(1) |
81 | | -template <class T, class P1> |
82 | | -IC T* xr_new(const P1& p1) |
83 | | -{ |
84 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T)); |
85 | | - return new (ptr)T(p1); |
86 | | -} |
87 | | -// new(2) |
88 | | -template <class T, class P1, class P2> |
89 | | -IC T* xr_new(const P1& p1, const P2& p2) |
90 | | -{ |
91 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T)); |
92 | | - return new (ptr)T(p1, p2); |
93 | | -} |
94 | | -// new(3) |
95 | | -template <class T, class P1, class P2, class P3> |
96 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3) |
97 | | -{ |
98 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T)); |
99 | | - return new (ptr)T(p1, p2, p3); |
100 | | -} |
101 | | -// new(4) |
102 | | -template <class T, class P1, class P2, class P3, class P4> |
103 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4) |
104 | | -{ |
105 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T)); |
106 | | - return new (ptr)T(p1, p2, p3, p4); |
107 | | -} |
108 | | -// new(5) |
109 | | -template <class T, class P1, class P2, class P3, class P4, class P5> |
110 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5) |
111 | | -{ |
112 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T)); |
113 | | - return new (ptr)T(p1, p2, p3, p4, p5); |
114 | | -} |
115 | | -// new(6) |
116 | | -template <class T, class P1, class P2, class P3, class P4, class P5, class P6> |
117 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6) |
118 | | -{ |
119 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T)); |
120 | | - return new (ptr)T(p1, p2, p3, p4, p5, p6); |
121 | | -} |
122 | | -// new(7) |
123 | | -template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7> |
124 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6, const P7& p7) |
125 | | -{ |
126 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T)); |
127 | | - return new (ptr)T(p1, p2, p3, p4, p5, p6, p7); |
128 | | -} |
129 | | -// new(8) |
130 | | -template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8> |
131 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6, const P7& p7, const P8& p8) |
132 | | -{ |
133 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T)); |
134 | | - return new (ptr)T(p1, p2, p3, p4, p5, p6, p7, p8); |
135 | | -} |
136 | | -// new(9) |
137 | | -template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9> |
138 | | -IC T* xr_new(const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6, const P7& p7, const P8& p8, const P8& p9) |
139 | | -{ |
140 | | - T* ptr = (T*)Memory.mem_alloc(sizeof(T)); |
141 | | - return new (ptr)T(p1, p2, p3, p4, p5, p6, p7, p8, p9); |
142 | | -} |
143 | | -#endif // DEBUG_MEMORY_NAME |
144 | | - |
145 | 1 | template <bool _is_pm, typename T> |
146 | 2 | struct xr_special_free |
147 | 3 | { |
|
0 commit comments