git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/python/Screens/RecordPaths.py: fix spinners in some conditions
[enigma2.git]
/
lib
/
base
/
object.h
diff --git
a/lib/base/object.h
b/lib/base/object.h
index 8ac92b83b0a0ab91e295fe2c7cb07113eb97f41c..a3268d4f3851de9357ba3d749891b4829e87b95a 100644
(file)
--- a/
lib/base/object.h
+++ b/
lib/base/object.h
@@
-17,10
+17,17
@@
private:
/* we don't allow the default operator here, as it would break the refcount. */
void operator=(const iObject &);
protected:
/* we don't allow the default operator here, as it would break the refcount. */
void operator=(const iObject &);
protected:
+ void operator delete(void *p) { ::operator delete(p); }
virtual ~iObject() { }
virtual ~iObject() { }
+#ifdef SWIG
+ virtual void AddRef()=0;
+ virtual void Release()=0;
+#endif
public:
public:
+#ifndef SWIG
virtual void AddRef()=0;
virtual void Release()=0;
virtual void AddRef()=0;
virtual void Release()=0;
+#endif
};
#ifndef SWIG
};
#ifndef SWIG
@@
-43,10
+50,10
@@
public:
#if defined(OBJECT_DEBUG)
extern int object_total_remaining;
#define DECLARE_REF(x) \
#if defined(OBJECT_DEBUG)
extern int object_total_remaining;
#define DECLARE_REF(x) \
- private:oRefCount ref; \
- eSingleLock ref_lock; \
public: void AddRef(); \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private:oRefCount ref; \
+ eSingleLock ref_lock;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
@@
-68,9
+75,9
@@
public:
}
#elif defined(__mips__)
#define DECLARE_REF(x) \
}
#elif defined(__mips__)
#define DECLARE_REF(x) \
- private: oRefCount ref; \
public: void AddRef(); \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private: oRefCount ref;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
@@
-108,9
+115,9
@@
public:
}
#elif defined(__ppc__) || defined(__powerpc__)
#define DECLARE_REF(x) \
}
#elif defined(__ppc__) || defined(__powerpc__)
#define DECLARE_REF(x) \
- private: oRefCount ref; \
public: void AddRef(); \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private: oRefCount ref;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
@@
-140,35
+147,35
@@
public:
if (!ref) \
delete this; \
}
if (!ref) \
delete this; \
}
- #elif defined(__i386__)
+ #elif defined(__i386__)
|| defined(__x86_64__)
#define DECLARE_REF(x) \
#define DECLARE_REF(x) \
- private: oRefCount ref; \
public: void AddRef(); \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private: oRefCount ref;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
__asm__ __volatile__( \
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
__asm__ __volatile__( \
- "
incl
%0 \n" \
+ "
lock ; incl
%0 \n" \
: "=m" (ref.count) \
: "=m" (ref.count) \
- : "m" (ref.count); \
+ : "m" (ref.count)
)
; \
} \
void c::Release() \
{ \
__asm__ __volatile__( \
} \
void c::Release() \
{ \
__asm__ __volatile__( \
- "
decl
%0 \n" \
+ "
lock ; decl
%0 \n" \
: "=m" (ref.count) \
: "=m" (ref.count) \
- : "m" (ref.count); \
+ : "m" (ref.count)
)
; \
if (!ref) \
delete this; \
}
#else
#warning use non optimized implementation of refcounting.
#define DECLARE_REF(x) \
if (!ref) \
delete this; \
}
#else
#warning use non optimized implementation of refcounting.
#define DECLARE_REF(x) \
- private:oRefCount ref; \
- eSingleLock ref_lock; \
public: void AddRef(); \
public: void AddRef(); \
- void Release();
+ void Release(); \
+ private:oRefCount ref; \
+ eSingleLock ref_lock;
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
#define DEFINE_REF(c) \
void c::AddRef() \
{ \
@@
-190,9
+197,6
@@
public:
private: \
void AddRef(); \
void Release();
private: \
void AddRef(); \
void Release();
- class Object
- {
- };
#endif // SWIG
#endif // __base_object_h
#endif // SWIG
#endif // __base_object_h