Skip to content

Commit c0926af

Browse files
author
nitrocaster
committed
Remove xr_new templates.
1 parent 8dfdc4d commit c0926af

File tree

2 files changed

+0
-193
lines changed

2 files changed

+0
-193
lines changed

src/xrCore/xrMemory_subst_borland.h

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,4 @@
1-
// new(0)
2-
template <class T>
3-
IC T* xr_new()
4-
{
5-
return new T();
6-
}
7-
// new(1)
8-
template <class T, class P1>
9-
IC T* xr_new(P1 p1)
10-
{
11-
return new T(p1);
12-
}
13-
// new(2)
14-
template <class T, class P1, class P2>
15-
IC T* xr_new(P1 p1, P2 p2)
16-
{
17-
return new T(p1, p2);
18-
}
19-
// new(3)
20-
template <class T, class P1, class P2, class P3>
21-
IC T* xr_new(P1 p1, P2 p2, P3 p3)
22-
{
23-
return new T(p1, p2, p3);
24-
}
25-
// new(4)
26-
template <class T, class P1, class P2, class P3, class P4>
27-
IC T* xr_new(P1 p1, P2 p2, P3 p3, P4 p4)
28-
{
29-
return new T(p1, p2, p3, p4);
30-
}
31-
// new(5)
32-
template <class T, class P1, class P2, class P3, class P4, class P5>
33-
IC T* xr_new(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
34-
{
35-
return new T(p1, p2, p3, p4, p5);
36-
}
37-
// new(6)
38-
template <class T, class P1, class P2, class P3, class P4, class P5, class P6>
39-
IC T* xr_new(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
40-
{
41-
return new T(p1, p2, p3, p4, p5, p6);
42-
}
43-
// new(7)
44-
template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7>
45-
IC T* xr_new(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
46-
{
47-
return new T(p1, p2, p3, p4, p5, p6, p7);
48-
}
491

50-
// #define xr_delete(ptr) if (ptr){delete ptr; ptr=0;}
512
template <class T>
523
IC void xr_delete(T*& ptr)
534
{

src/xrCore/xrMemory_subst_msvc.h

Lines changed: 0 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,147 +1,3 @@
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-
1451
template <bool _is_pm, typename T>
1462
struct xr_special_free
1473
{

0 commit comments

Comments
 (0)