diff options
author | Robin Burchell <robin+qt@viroteck.net> | 2012-03-22 21:44:13 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-31 16:46:40 +0200 |
commit | 47728445a5e7317ed2123a8824c54a012eeee142 (patch) | |
tree | 762385979cf489c0cb92a061ed7bde3cd077c851 /src/corelib/global/qglobal.h | |
parent | ad921347f701ea7f732633c9c584be9300317537 (diff) |
Remove all calls to, and deprecate qMalloc, qRealloc and qFree.
Callers should just call the standard allocation functions directly.
Adding an extra function call onto all basic memory management for the sake of
making it instrumentable in rare cases isn't really fair to everyone else.
What's more, this wasn't completely reliable, as not everything was using them
in a number of places. Memory management can still be overridden using tricks
like LD_PRELOAD if needed.
Their aligned equivilents cannot be deprecated, as no standard equivilents
exist, although investigation into posix_memalign(3) is a possibility
for the future.
Change-Id: Ic5f74b14be33f8bc188fe7236c55e15c36a23fc7
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/global/qglobal.h')
-rw-r--r-- | src/corelib/global/qglobal.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 24e05fc72c..22f65a6aba 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1193,13 +1193,11 @@ inline void qSwap(T &value1, T &value2) #endif } -/* - These functions make it possible to use standard C++ functions with - a similar name from Qt header files (especially template classes). -*/ -Q_CORE_EXPORT void *qMalloc(size_t size) Q_ALLOC_SIZE(1); -Q_CORE_EXPORT void qFree(void *ptr); -Q_CORE_EXPORT void *qRealloc(void *ptr, size_t size) Q_ALLOC_SIZE(2); +#if QT_DEPRECATED_SINCE(5, 0) +Q_CORE_EXPORT QT_DEPRECATED void *qMalloc(size_t size) Q_ALLOC_SIZE(1); +Q_CORE_EXPORT QT_DEPRECATED void qFree(void *ptr); +Q_CORE_EXPORT QT_DEPRECATED void *qRealloc(void *ptr, size_t size) Q_ALLOC_SIZE(2); +#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); |