Rename the private helper function QList::free() to QList::dealloc()

As the comment suggests, renaming this function avoids confusion with
libc's free().

Change-Id: Ia077b92c947d81ef9d78de940a1cd8ed022edb3c
Reviewed-on: http://codereview.qt.nokia.com/4063
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
bb10
Bradley T. Hughes 2011-09-01 11:58:22 +02:00 committed by Qt by Nokia
parent 80559d6cd3
commit 2c8a4fae84
1 changed files with 6 additions and 7 deletions

View File

@ -334,7 +334,7 @@ private:
Node *detach_helper_grow(int i, int n);
void detach_helper(int alloc);
void detach_helper();
void free(QListData::Data *d);
void dealloc(QListData::Data *d);
void node_construct(Node *n, const T &t);
void node_destruct(Node *n);
@ -422,7 +422,7 @@ Q_INLINE_TEMPLATE QList<T> &QList<T>::operator=(const QList<T> &l)
QListData::Data *o = l.d;
o->ref.ref();
if (!d->ref.deref())
free(d);
dealloc(d);
d = o;
if (!d->sharable)
detach_helper();
@ -679,7 +679,7 @@ Q_OUTOFLINE_TEMPLATE typename QList<T>::Node *QList<T>::detach_helper_grow(int i
}
if (!x->ref.deref())
free(x);
dealloc(x);
return reinterpret_cast<Node *>(p.begin() + i);
}
@ -698,7 +698,7 @@ Q_OUTOFLINE_TEMPLATE void QList<T>::detach_helper(int alloc)
}
if (!x->ref.deref())
free(x);
dealloc(x);
}
template <typename T>
@ -711,7 +711,7 @@ template <typename T>
Q_OUTOFLINE_TEMPLATE QList<T>::~QList()
{
if (!d->ref.deref())
free(d);
dealloc(d);
}
template <typename T>
@ -732,9 +732,8 @@ Q_OUTOFLINE_TEMPLATE bool QList<T>::operator==(const QList<T> &l) const
return true;
}
// ### Qt 5: rename freeData() to avoid confusion with std::free()
template <typename T>
Q_OUTOFLINE_TEMPLATE void QList<T>::free(QListData::Data *data)
Q_OUTOFLINE_TEMPLATE void QList<T>::dealloc(QListData::Data *data)
{
node_destruct(reinterpret_cast<Node *>(data->array + data->begin),
reinterpret_cast<Node *>(data->array + data->end));