From b08daaedd45457b775cb90d2c2650510daff1c8d Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 20 Dec 2011 21:39:12 +0100 Subject: Remove all non-inline of qMalloc/qFree/qRealloc. We're trying to deprecate these, so don't use them anymore. The inline uses of these have been left intact, for the moment. Inline code will need to create their own non-inline allocation methods (for future-proofing to allow alterations in how e.g. individual containers allocate) Change-Id: I1071a487c25e95b7bb81a3327b20c5481fb5ed22 Reviewed-by: Thiago Macieira Reviewed-by: Bradley T. Hughes --- src/corelib/tools/qlist.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/corelib/tools/qlist.cpp') diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index 9ac46365a2..adc6ee7a4b 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -42,7 +42,9 @@ #include #include "qlist.h" #include "qtools_p.h" + #include +#include QT_BEGIN_NAMESPACE @@ -82,7 +84,7 @@ QListData::Data *QListData::detach_grow(int *idx, int num) int l = x->end - x->begin; int nl = l + num; int alloc = grow(nl); - Data* t = static_cast(qMalloc(DataHeaderSize + alloc * sizeof(void *))); + Data* t = static_cast(::malloc(DataHeaderSize + alloc * sizeof(void *))); Q_CHECK_PTR(t); t->ref = 1; @@ -124,7 +126,7 @@ QListData::Data *QListData::detach_grow(int *idx, int num) QListData::Data *QListData::detach(int alloc) { Data *x = d; - Data* t = static_cast(qMalloc(DataHeaderSize + alloc * sizeof(void *))); + Data* t = static_cast(::malloc(DataHeaderSize + alloc * sizeof(void *))); Q_CHECK_PTR(t); t->ref = 1; @@ -145,7 +147,7 @@ QListData::Data *QListData::detach(int alloc) void QListData::realloc(int alloc) { Q_ASSERT(d->ref == 1); - Data *x = static_cast(qRealloc(d, DataHeaderSize + alloc * sizeof(void *))); + Data *x = static_cast(::realloc(d, DataHeaderSize + alloc * sizeof(void *))); Q_CHECK_PTR(x); d = x; -- cgit v1.2.3