summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/CMakeLists.txt2
-rw-r--r--src/corelib/global/qglobal.h5
-rw-r--r--src/corelib/global/qmalloc.cpp1
-rw-r--r--src/corelib/global/qmalloc.h22
4 files changed, 25 insertions, 5 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index 101023db6b8..ddb32ac5fb8 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -64,7 +64,7 @@ qt_internal_add_module(Core
global/qhooks.cpp global/qhooks_p.h
global/qlibraryinfo.cpp global/qlibraryinfo.h global/qlibraryinfo_p.h
global/qlogging.cpp global/qlogging.h global/qlogging_p.h
- global/qmalloc.cpp
+ global/qmalloc.cpp global/qmalloc.h
global/qminmax.h
global/qnamespace.h # this header is specified on purpose so AUTOMOC processes it
global/qnativeinterface.h global/qnativeinterface_p.h
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 01a48981329..42e8698965f 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -136,10 +136,6 @@ typedef void (*QFunctionPointer)();
# define Q_UNIMPLEMENTED() qWarning("Unimplemented code.")
#endif
-Q_CORE_EXPORT void *qMallocAligned(size_t size, size_t alignment) Q_ALLOC_SIZE(1);
-Q_CORE_EXPORT void *qReallocAligned(void *ptr, size_t size, size_t oldsize, size_t alignment) Q_ALLOC_SIZE(2);
-Q_CORE_EXPORT void qFreeAligned(void *ptr);
-
// this adds const to non-const objects (like std::as_const)
template <typename T>
@@ -174,6 +170,7 @@ QT_END_NAMESPACE
#include <QtCore/qexceptionhandling.h>
#include <QtCore/qforeach.h>
#include <QtCore/qglobalstatic.h>
+#include <QtCore/qmalloc.h>
#include <QtCore/qminmax.h>
#include <QtCore/qnumeric.h>
#include <QtCore/qoverload.h>
diff --git a/src/corelib/global/qmalloc.cpp b/src/corelib/global/qmalloc.cpp
index be86aaf0573..d413a35c6b1 100644
--- a/src/corelib/global/qmalloc.cpp
+++ b/src/corelib/global/qmalloc.cpp
@@ -1,6 +1,7 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#include "qmalloc.h"
#include "qplatformdefs.h"
#include <stdlib.h>
diff --git a/src/corelib/global/qmalloc.h b/src/corelib/global/qmalloc.h
new file mode 100644
index 00000000000..c83aecd47cf
--- /dev/null
+++ b/src/corelib/global/qmalloc.h
@@ -0,0 +1,22 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QMALLOC_H
+#define QMALLOC_H
+
+#include <QtCore/qglobal.h>
+
+#if 0
+#pragma qt_class(QtMalloc)
+#pragma qt_sync_stop_processing
+#endif
+
+QT_BEGIN_NAMESPACE
+
+Q_CORE_EXPORT void *qMallocAligned(size_t size, size_t alignment) Q_ALLOC_SIZE(1);
+Q_CORE_EXPORT void *qReallocAligned(void *ptr, size_t size, size_t oldsize, size_t alignment) Q_ALLOC_SIZE(2);
+Q_CORE_EXPORT void qFreeAligned(void *ptr);
+
+QT_END_NAMESPACE
+
+#endif // QMALLOC_H