diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2024-04-23 17:34:01 -0700 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2024-05-02 17:12:30 -0700 |
| commit | fe6dda9bb9310878b408b2421f60acb7135bd8ba (patch) | |
| tree | 7d727aeb0f76fa12d89057f71b04db5889f7a4e7 /src/corelib/io/qresource.cpp | |
| parent | 39e156e639ac4eadd7a0d4dac73d05db077e817b (diff) | |
QResource: move the internal classes to unnamed namespaces
So the compiler has more opportunities to inline and to not emit out-of-
line copies.
Pick-to: 6.7
Change-Id: I6979d02a7395405cbf23fffd17c9101b2b52472a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Diffstat (limited to 'src/corelib/io/qresource.cpp')
| -rw-r--r-- | src/corelib/io/qresource.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index a5cc979635c..8f2abff0aba 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -65,6 +65,7 @@ RCC_FEATURE_SYMBOL(Zstd) #undef RCC_FEATURE_SYMBOL +namespace { class QStringSplitter { public: @@ -159,15 +160,18 @@ static QString cleanPath(const QString &_path) path.remove(0, 1); return path; } +} // unnamed namespace Q_DECLARE_TYPEINFO(QResourceRoot, Q_RELOCATABLE_TYPE); typedef QList<QResourceRoot*> ResourceList; +namespace { struct QResourceGlobalData { QRecursiveMutex resourceMutex; ResourceList resourceList; }; +} Q_GLOBAL_STATIC(QResourceGlobalData, resourceGlobalData) static inline QRecursiveMutex &resourceMutex() @@ -1031,8 +1035,8 @@ Q_CORE_EXPORT bool qUnregisterResourceData(int version, const unsigned char *tre return false; } +namespace { // run time resource creation - class QDynamicBufferResourceRoot : public QResourceRoot { QString root; @@ -1131,6 +1135,7 @@ public: bool registerSelf(const QString &f); }; +} // unnamed namespace #ifndef MAP_FILE # define MAP_FILE 0 |
