17#include <private/qv4global_p.h>
18#include <private/qv4mmdefs_p.h>
19#include <private/qv4writebarrier_p.h>
20#include <private/qv4vtable_p.h>
21#include <QtCore/QSharedPointer>
25#undef QML_CHECK_INIT_DESTROY_CALLS
33template <
typename T,
size_t o>
37 operator T ()
const {
return get(); }
45 T
get()
const {
return reinterpret_cast<T
>(ptr); }
47 template <
typename Type>
59 void *
operator new(size_t) =
delete;
71 Q_ASSERT(!Chunk::testBit(
c->extendsBitmap,
h -
c->realBase()));
72 return Chunk::testBit(
c->blackBitmap,
h -
c->realBase());
77 Q_ASSERT(!Chunk::testBit(
c->extendsBitmap,
h -
c->realBase()));
78 return Chunk::setBit(
c->blackBitmap,
h -
c->realBase());
84 Q_ASSERT(!Chunk::testBit(
c->extendsBitmap,
h -
c->realBase()));
85 return Chunk::testBit(
c->objectBitmap,
h -
c->realBase());
88 void *
operator new(size_t,
Managed *
m) {
return m; }
89 void *
operator new(size_t,
Base *
m) {
return m; }
90 void operator delete(
void *,
Base *) {}
92 void init() { _setInitialized(); }
94#ifdef QML_CHECK_INIT_DESTROY_CALLS
96 void _checkIsInitialized() {
98 fprintf(stderr,
"ERROR: use of object '%s' before call to init() !!\n",
100 else if (_livenessStatus == Destroyed)
101 fprintf(stderr,
"ERROR: use of object '%s' after call to destroy() !!\n",
105 void _checkIsDestroyed() {
107 fprintf(stderr,
"ERROR: object '%s' was never destroyed completely !!\n",
109 Q_ASSERT(_livenessStatus == Destroyed);
112 void _setDestroyed() {
114 fprintf(stderr,
"ERROR: attempting to destroy an uninitialized object '%s' !!\n",
116 else if (_livenessStatus == Destroyed)
117 fprintf(stderr,
"ERROR: attempting to destroy repeatedly object '%s' !!\n",
149 markStack->
push(
this);
153template<
typename T,
size_t o>
196 operator T*()
const {
return data(); }
213 return d !=
nullptr && qObject !=
nullptr;
T loadRelaxed() const noexcept
Combined button and popup list for selecting options.
Pointer< char *, 0 > V4PointerCheck
void write(EngineBase *engine, Heap::Base *base, ReturnedValue *slot, ReturnedValue value)
\qmltype Particle \inqmlmodule QtQuick.Particles
#define Q_STATIC_ASSERT(Condition)
GLenum GLuint GLintptr offset
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
const char className[16]
[1]
static bool testBit(quintptr *bitmap, size_t index)
static Q_ALWAYS_INLINE quintptr bitForIndex(size_t index)
static Q_ALWAYS_INLINE size_t bitmapIndex(size_t index)
void mark(QV4::MarkStack *markStack)
Q_ALWAYS_INLINE void _setInitialized()
Q_ALWAYS_INLINE void _checkIsInitialized()
Q_ALWAYS_INLINE void _setDestroyed()
Q_ALWAYS_INLINE void _checkIsDestroyed()
Pointer< InternalClass *, 0 > internalClass
Base * heapObject() const
void set(EngineBase *e, T newVal)
bool isValid() const noexcept
bool isNull() const noexcept
QV4QPointer & operator=(T *o)
QBasicAtomicInt strongref
static Q_CORE_EXPORT ExternalRefCountData * getAndRef(const QObject *)