ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtutil.h
(Generate patch)

Comparing rxvt-unicode/src/rxvtutil.h (file contents):
Revision 1.59 by sf-exg, Thu Oct 23 22:39:40 2014 UTC vs.
Revision 1.60 by sf-exg, Tue Oct 28 09:05:33 2014 UTC

61{ 61{
62 void *operator new (size_t s); 62 void *operator new (size_t s);
63 void operator delete (void *p, size_t s); 63 void operator delete (void *p, size_t s);
64}; 64};
65 65
66// alas new/delete cannot be specified as inline in C++11 (see 17.6.4.6)
67void *operator new (size_t s) throw (std::bad_alloc);
68void operator delete (void *p) throw ();
69
66struct stringvec : simplevec<char *> 70struct stringvec : simplevec<char *>
67{ 71{
68 ~stringvec () 72 ~stringvec ()
69 { 73 {
70 for (char **c = begin (); c != end (); c++) 74 for (char **c = begin (); c != end (); c++)
86 iterator end () const { return (iterator)simplevec<void *>::end (); } 90 iterator end () const { return (iterator)simplevec<void *>::end (); }
87 T &operator [] (int i) { return * (T *) (& ((* (simplevec<void *> *)this)[i])); } 91 T &operator [] (int i) { return * (T *) (& ((* (simplevec<void *> *)this)[i])); }
88 const T &operator [] (int i) const { return * (const T *) (& ((* (const simplevec<void *> *)this)[i])); } 92 const T &operator [] (int i) const { return * (const T *) (& ((* (const simplevec<void *> *)this)[i])); }
89}; 93};
90#endif 94#endif
91
92inline void *
93operator new (size_t size) throw (std::bad_alloc)
94{
95 // TODO: use rxvt_malloc
96 return malloc (size);
97}
98
99inline void
100operator delete (void *p) throw ()
101{
102 free (p);
103}
104 95
105template<typename T> 96template<typename T>
106struct auto_ptr 97struct auto_ptr
107{ 98{
108 T *p; 99 T *p;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines