summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qscopedpointer.h
diff options
context:
space:
mode:
authorRobin Burchell <robin+qt@viroteck.net>2012-03-22 21:44:13 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-31 16:46:40 +0200
commit47728445a5e7317ed2123a8824c54a012eeee142 (patch)
tree762385979cf489c0cb92a061ed7bde3cd077c851 /src/corelib/tools/qscopedpointer.h
parentad921347f701ea7f732633c9c584be9300317537 (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/tools/qscopedpointer.h')
-rw-r--r--src/corelib/tools/qscopedpointer.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
index 4e1027e86a..c01a623414 100644
--- a/src/corelib/tools/qscopedpointer.h
+++ b/src/corelib/tools/qscopedpointer.h
@@ -44,6 +44,8 @@
#include <QtCore/qglobal.h>
+#include <stdlib.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -79,7 +81,7 @@ struct QScopedPointerArrayDeleter
struct QScopedPointerPodDeleter
{
- static inline void cleanup(void *pointer) { if (pointer) qFree(pointer); }
+ static inline void cleanup(void *pointer) { if (pointer) free(pointer); }
};
template <typename T, typename Cleanup = QScopedPointerDeleter<T> >