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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
*** ../pwlib/src/ptlib/common/object.cxx.orig Tue Oct 29 00:21:28 2002
--- ../pwlib/src/ptlib/common/object.cxx Tue Oct 29 00:22:07 2002
***************
*** 27,32 ****
--- 27,38 ----
* Contributor(s): ______________________________________.
*
* $Log: object.cxx,v $
+ * Revision 1.62 2002/10/21 12:52:27 rogerh
+ * Add throw()s to new and delete. Error reported by FreeBSD 5.0 and GCC 3.2.1
+ *
+ * Revision 1.61 2002/10/10 04:43:44 robertj
+ * VxWorks port, thanks Martijn Roest
+ *
* Revision 1.60 2002/09/06 05:29:42 craigs
* Reversed order of memory block check on delete to improve performance in
* Linux debug mode
*************** void PAssertFunc(const char * file, int
*** 308,332 ****
--- 314,354 ----
#undef free
+ #if __GNUC__ >= 3
+ void * operator new(size_t nSize) throw (std::bad_alloc)
+ #else
void * operator new(size_t nSize)
+ #endif
{
return PMemoryHeap::Allocate(nSize, (const char *)NULL, 0, NULL);
}
+ #if __GNUC__ >= 3
+ void * operator new[](size_t nSize) throw (std::bad_alloc)
+ #else
void * operator new[](size_t nSize)
+ #endif
{
return PMemoryHeap::Allocate(nSize, (const char *)NULL, 0, NULL);
}
+ #if __GNUC__ >= 3
+ void operator delete(void * ptr) throw()
+ #else
void operator delete(void * ptr)
+ #endif
{
PMemoryHeap::Deallocate(ptr, NULL);
}
+ #if __GNUC__ >= 3
+ void operator delete[](void * ptr) throw()
+ #else
void operator delete[](void * ptr)
+ #endif
{
PMemoryHeap::Deallocate(ptr, NULL);
}
*************** void PMemoryHeap::InternalDumpObjectsSin
*** 814,829 ****
--- 836,863 ----
#else // PMEMORY_CHECK
+ #ifndef P_VXWORKS
+
+ #if __GNUC__ >= 3
+ void * operator new[](size_t nSize) throw (std::bad_alloc)
+ #else
void * operator new[](size_t nSize)
+ #endif
{
return malloc(nSize);
}
+ #if __GNUC__ >= 3
+ void operator delete[](void * ptr) throw ()
+ #else
void operator delete[](void * ptr)
+ #endif
{
free(ptr);
}
+ #endif // !P_VXWORKS
+
#endif // PMEMORY_CHECK
*************** istream & operator>>(istream & stream, P
*** 1505,1510 ****
--- 1539,1574 ----
#endif
+
+
+ #ifdef P_TORNADO
+
+ // the library provided with Tornado 2.0 does not contain implementation
+ // for the functions defined below, therefor the own implementation
+
+ ostream & ostream::operator<<(PInt64 v)
+ {
+ return *this << (long)(v >> 32) << (long)(v & 0xFFFFFFFF);
+ }
+
+
+ ostream & ostream::operator<<(PUInt64 v)
+ {
+ return *this << (long)(v >> 32) << (long)(v & 0xFFFFFFFF);
+ }
+
+ istream & istream::operator>>(PInt64 & v)
+ {
+ return *this >> (long)(v >> 32) >> (long)(v & 0xFFFFFFFF);
+ }
+
+
+ istream & istream::operator>>(PUInt64 & v)
+ {
+ return *this >> (long)(v >> 32) >> (long)(v & 0xFFFFFFFF);
+ }
+
+ #endif // P_TORNADO
// End Of File ///////////////////////////////////////////////////////////////
|