diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-09-29 18:07:23 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-03 21:53:38 +0100 |
commit | 9fc0965d1930b32277dd3845cb94b650aec67ac8 (patch) | |
tree | 07e94df723e07c6eb37dd04901781450599b8bf3 /src/corelib/io/qtextstream_p.h | |
parent | 28d77c24c2deec2eee8c735b299f0da792d75c9f (diff) |
Repack structs with more than one padding hole
Sizes gained (measured on 64-bit systems)
BezierEase: shrunk 8 bytes
QRegExpCharClass: shrunk 8 bytes
QRegularExpressionPrivate: shrunk 8 bytes
QTimeLinePrivate: shrunk 8 bytes
QUtcTimeZonePrivate: shrunk 8 bytes
QTextStreamPrivate: shrunk 8 bytes
QDirPrivate: shrunk 8 bytes
QFileDevicePrivate: shrunk 8 bytes
Not done:
QRegExpEngine: 18 bytes in 6 holes (you deserve high memory usage if
you're still using QRegExp)
QTextBoundaryFinder: 8 bytes in 2 holes (public class)
QIODevicePrivate: 6 bytes in 2 holes, but there's no gain in packing
QProcessPrivate: too complex and my copy is modified
QThreadData: awaiting change from Marc
Change-Id: I2a388b5ce17dec0dafcef18ed2e80d0379aa7d1e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qtextstream_p.h')
-rw-r--r-- | src/corelib/io/qtextstream_p.h | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/src/corelib/io/qtextstream_p.h b/src/corelib/io/qtextstream_p.h index d5d5288426..ac6529e195 100644 --- a/src/corelib/io/qtextstream_p.h +++ b/src/corelib/io/qtextstream_p.h @@ -88,6 +88,21 @@ class QTextStreamPrivate { Q_DECLARE_PUBLIC(QTextStream) public: + // streaming parameters + class Params + { + public: + void reset(); + + int realNumberPrecision; + int integerBase; + int fieldWidth; + QChar padChar; + QTextStream::FieldAlignment fieldAlignment; + QTextStream::RealNumberNotation realNumberNotation; + QTextStream::NumberFlags numberFlags; + }; + QTextStreamPrivate(QTextStream *q_ptr); ~QTextStreamPrivate(); void reset(); @@ -97,7 +112,6 @@ public: #ifndef QT_NO_QOBJECT QDeviceClosedNotifier deviceClosedNotifier; #endif - bool deleteDevice; // string QString *string; @@ -110,6 +124,24 @@ public: QTextCodec::ConverterState readConverterState; QTextCodec::ConverterState writeConverterState; QTextCodec::ConverterState *readConverterSavedState; +#endif + + QString writeBuffer; + QString readBuffer; + int readBufferOffset; + int readConverterSavedStateOffset; //the offset between readBufferStartDevicePos and that start of the buffer + qint64 readBufferStartDevicePos; + + Params params; + + // status + QTextStream::Status status; + QLocale locale; + QTextStream *q_ptr; + + int lastTokenSize; + bool deleteDevice; +#ifndef QT_NO_TEXTCODEC bool autoDetectUnicode; #endif @@ -128,7 +160,6 @@ public: inline void consume(int nchars); void saveConverterState(qint64 newPos); void restoreToSavedConverterState(); - int lastTokenSize; // Return value type for getNumber() enum NumberParsingStatus { @@ -150,34 +181,6 @@ public: bool fillReadBuffer(qint64 maxBytes = -1); void resetReadBuffer(); void flushWriteBuffer(); - QString writeBuffer; - QString readBuffer; - int readBufferOffset; - int readConverterSavedStateOffset; //the offset between readBufferStartDevicePos and that start of the buffer - qint64 readBufferStartDevicePos; - - // streaming parameters - class Params - { - public: - void reset(); - - int realNumberPrecision; - int integerBase; - int fieldWidth; - QChar padChar; - QTextStream::FieldAlignment fieldAlignment; - QTextStream::RealNumberNotation realNumberNotation; - QTextStream::NumberFlags numberFlags; - }; - Params params; - - // status - QTextStream::Status status; - - QLocale locale; - - QTextStream *q_ptr; }; QT_END_NAMESPACE |