diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-06-01 00:22:35 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-06-03 12:02:55 +0000 |
commit | 133e40283155852585b5fc409909a00e920cfcfc (patch) | |
tree | 741cb5b83260c70f7fc37ef1a83dac4d4f37c493 /src/gui/opengl | |
parent | b295afb064d728d8f59d0129979c019761624bca (diff) |
De-duplicate vtables, part I: exported private classes
By making the destructor (usually the first non-inline, non-pure,
virtual function, and therefore the trigger for most compilers to
emit the vtable and type_info structures for the class in that TU)
out-of-line, vtables and, more importantly, type_info structures for
the class are pinned to a single TU. This prevents false negative
dynamic_cast and catch evaluation.
In this first batch, we de-inline destructors of exported private
classes.
Since they are already exported, users of these classes are unaffected
by the change, and since it's private API, we don't need to avoid
adding code to the out-of-line destructor until Qt 6.
Change-Id: I450707877d2cb6a77f79ae1dd355facb98d6c517
Reported-by: Volker Krause <volker.krause@kdab.com>
Task-number: QTBUG-45582
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r-- | src/gui/opengl/qopenglpaintdevice.cpp | 4 | ||||
-rw-r--r-- | src/gui/opengl/qopenglpaintdevice_p.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp index c0657feaa0..e509b26a95 100644 --- a/src/gui/opengl/qopenglpaintdevice.cpp +++ b/src/gui/opengl/qopenglpaintdevice.cpp @@ -169,6 +169,10 @@ QOpenGLPaintDevicePrivate::QOpenGLPaintDevicePrivate(const QSize &sz) { } +QOpenGLPaintDevicePrivate::~QOpenGLPaintDevicePrivate() +{ +} + class QOpenGLEngineThreadStorage { public: diff --git a/src/gui/opengl/qopenglpaintdevice_p.h b/src/gui/opengl/qopenglpaintdevice_p.h index 57d93ee80a..54ea09240d 100644 --- a/src/gui/opengl/qopenglpaintdevice_p.h +++ b/src/gui/opengl/qopenglpaintdevice_p.h @@ -56,7 +56,7 @@ class Q_GUI_EXPORT QOpenGLPaintDevicePrivate { public: QOpenGLPaintDevicePrivate(const QSize &size); - virtual ~QOpenGLPaintDevicePrivate() { } + virtual ~QOpenGLPaintDevicePrivate(); static QOpenGLPaintDevicePrivate *get(QOpenGLPaintDevice *dev) { return dev->d_func(); } |