From: João Abecasis Date: Mon, 16 Jan 2012 16:52:29 +0000 (+0100) Subject: Merge remote-tracking branch 'gerrit/master' into containers X-Git-Tag: 071012110112~1235^2^2~294^2^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b250d497fd798c476765b22a2906e1c0ff1e432;p=profile%2Fivi%2Fqtbase.git Merge remote-tracking branch 'gerrit/master' into containers Change-Id: I2d358b912f1055ee6021d13de2f66fd459aaa355 --- 5b250d497fd798c476765b22a2906e1c0ff1e432 diff --cc src/corelib/tools/qbytearray.cpp index e56e4fc,8c625c2..47bf5da --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@@ -1302,9 -1302,9 +1302,9 @@@ QByteArray::QByteArray(const char *str d = const_cast(&shared_empty.ba); } else { int len = qstrlen(str); - d = static_cast(qMalloc(sizeof(Data) + len + 1)); + d = static_cast(malloc(sizeof(Data) + len + 1)); Q_CHECK_PTR(d); - d->ref = 1; + d->ref.initializeOwned(); d->size = len; d->alloc = len; d->capacityReserved = false; @@@ -1331,9 -1331,9 +1331,9 @@@ QByteArray::QByteArray(const char *data } else if (size <= 0) { d = const_cast(&shared_empty.ba); } else { - d = static_cast(qMalloc(sizeof(Data) + size + 1)); + d = static_cast(malloc(sizeof(Data) + size + 1)); Q_CHECK_PTR(d); - d->ref = 1; + d->ref.initializeOwned(); d->size = size; d->alloc = size; d->capacityReserved = false; @@@ -1355,9 -1355,9 +1355,9 @@@ QByteArray::QByteArray(int size, char c if (size <= 0) { d = const_cast(&shared_null.ba); } else { - d = static_cast(qMalloc(sizeof(Data) + size + 1)); + d = static_cast(malloc(sizeof(Data) + size + 1)); Q_CHECK_PTR(d); - d->ref = 1; + d->ref.initializeOwned(); d->size = size; d->alloc = size; d->capacityReserved = false; @@@ -1375,9 -1375,9 +1375,9 @@@ QByteArray::QByteArray(int size, Qt::Initialization) { - d = static_cast(qMalloc(sizeof(Data) + size + 1)); + d = static_cast(malloc(sizeof(Data) + size + 1)); Q_CHECK_PTR(d); - d->ref = 1; + d->ref.initializeOwned(); d->size = size; d->alloc = size; d->capacityReserved = false; @@@ -1422,9 -1422,9 +1422,9 @@@ void QByteArray::resize(int size // which is used in place of the Qt 3 idiom: // QByteArray a(sz); // - Data *x = static_cast(qMalloc(sizeof(Data) + size + 1)); + Data *x = static_cast(malloc(sizeof(Data) + size + 1)); Q_CHECK_PTR(x); - x->ref = 1; + x->ref.initializeOwned(); x->size = size; x->alloc = size; x->capacityReserved = false; @@@ -1464,9 -1464,9 +1464,9 @@@ QByteArray &QByteArray::fill(char ch, i void QByteArray::realloc(int alloc) { if (d->ref != 1 || d->offset) { - Data *x = static_cast(qMalloc(sizeof(Data) + alloc + 1)); + Data *x = static_cast(malloc(sizeof(Data) + alloc + 1)); Q_CHECK_PTR(x); - x->ref = 1; + x->ref.initializeOwned(); x->size = qMin(alloc, d->size); x->alloc = alloc; x->capacityReserved = d->capacityReserved; @@@ -3885,9 -3885,9 +3885,9 @@@ QByteArray QByteArray::fromRawData(cons } else if (!size) { x = const_cast(&shared_empty.ba); } else { - x = static_cast(qMalloc(sizeof(Data) + 1)); + x = static_cast(malloc(sizeof(Data) + 1)); Q_CHECK_PTR(x); - x->ref = 1; + x->ref.initializeOwned(); x->size = size; x->alloc = 0; x->capacityReserved = false; diff --cc src/corelib/tools/qlist.cpp index 2a3695b,adc6ee7..2afe1ab --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@@ -82,10 -84,10 +84,10 @@@ QListData::Data *QListData::detach_grow 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; + t->ref.initializeOwned(); t->sharable = true; t->alloc = alloc; // The space reservation algorithm's optimization is biased towards appending: @@@ -124,10 -126,10 +126,10 @@@ 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; + t->ref.initializeOwned(); t->sharable = true; t->alloc = alloc; if (!alloc) { diff --cc src/corelib/tools/qstring.cpp index d57adbe,1b6ff3c..dbe1e91 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@@ -1030,9 -1030,9 +1030,9 @@@ QString::QString(const QChar *unicode, } else if (size <= 0) { d = const_cast(&shared_empty.str); } else { - d = (Data*) qMalloc(sizeof(Data)+(size+1)*sizeof(QChar)); + d = (Data*) ::malloc(sizeof(Data)+(size+1)*sizeof(QChar)); Q_CHECK_PTR(d); - d->ref = 1; + d->ref.initializeOwned(); d->size = size; d->alloc = (uint) size; d->capacityReserved = false; @@@ -1062,9 -1062,9 +1062,9 @@@ QString::QString(const QChar *unicode if (!size) { d = const_cast(&shared_empty.str); } else { - d = (Data*) qMalloc(sizeof(Data)+(size+1)*sizeof(QChar)); + d = (Data*) ::malloc(sizeof(Data)+(size+1)*sizeof(QChar)); Q_CHECK_PTR(d); - d->ref = 1; + d->ref.initializeOwned(); d->size = size; d->alloc = (uint) size; d->capacityReserved = false; @@@ -1087,9 -1087,9 +1087,9 @@@ QString::QString(int size, QChar ch if (size <= 0) { d = const_cast(&shared_empty.str); } else { - d = (Data*) qMalloc(sizeof(Data)+(size+1)*sizeof(QChar)); + d = (Data*) ::malloc(sizeof(Data)+(size+1)*sizeof(QChar)); Q_CHECK_PTR(d); - d->ref = 1; + d->ref.initializeOwned(); d->size = size; d->alloc = (uint) size; d->capacityReserved = false; @@@ -1111,9 -1111,9 +1111,9 @@@ */ QString::QString(int size, Qt::Initialization) { - d = (Data*) qMalloc(sizeof(Data)+(size+1)*sizeof(QChar)); + d = (Data*) ::malloc(sizeof(Data)+(size+1)*sizeof(QChar)); Q_CHECK_PTR(d); - d->ref = 1; + d->ref.initializeOwned(); d->size = size; d->alloc = (uint) size; d->capacityReserved = false; @@@ -1133,9 -1133,9 +1133,9 @@@ */ QString::QString(QChar ch) { - d = (Data *) qMalloc(sizeof(Data) + 2*sizeof(QChar)); + d = (Data *) ::malloc(sizeof(Data) + 2*sizeof(QChar)); Q_CHECK_PTR(d); - d->ref = 1; + d->ref.initializeOwned(); d->size = 1; d->alloc = 1; d->capacityReserved = false; @@@ -1312,9 -1312,9 +1312,9 @@@ void QString::resize(int size void QString::realloc(int alloc) { if (d->ref != 1 || d->offset) { - Data *x = static_cast(qMalloc(sizeof(Data) + (alloc+1) * sizeof(QChar))); + Data *x = static_cast(::malloc(sizeof(Data) + (alloc+1) * sizeof(QChar))); Q_CHECK_PTR(x); - x->ref = 1; + x->ref.initializeOwned(); x->size = qMin(alloc, d->size); x->alloc = (uint) alloc; x->capacityReserved = d->capacityReserved; @@@ -3756,9 -3756,9 +3756,9 @@@ QString::Data *QString::fromLatin1_help } else { if (size < 0) size = qstrlen(str); - d = static_cast(qMalloc(sizeof(Data) + (size+1) * sizeof(QChar))); + d = static_cast(::malloc(sizeof(Data) + (size+1) * sizeof(QChar))); Q_CHECK_PTR(d); - d->ref = 1; + d->ref.initializeOwned(); d->size = size; d->alloc = (uint) size; d->capacityReserved = false; @@@ -7072,9 -7063,9 +7063,9 @@@ QString QString::fromRawData(const QCha } else if (!size) { x = const_cast(&shared_empty.str); } else { - x = static_cast(qMalloc(sizeof(Data) + sizeof(ushort))); + x = static_cast(::malloc(sizeof(Data) + sizeof(ushort))); Q_CHECK_PTR(x); - x->ref = 1; + x->ref.initializeOwned(); x->size = size; x->alloc = 0; x->capacityReserved = false;