Merge remote-tracking branch 'gerrit/master' into containers
authorJoão Abecasis <joao.abecasis@nokia.com>
Mon, 16 Jan 2012 16:52:29 +0000 (17:52 +0100)
committerJoão Abecasis <joao.abecasis@nokia.com>
Mon, 16 Jan 2012 16:53:41 +0000 (17:53 +0100)
Change-Id: I2d358b912f1055ee6021d13de2f66fd459aaa355

15 files changed:
1  2 
src/corelib/tools/qbytearray.cpp
src/corelib/tools/qbytearray.h
src/corelib/tools/qhash.cpp
src/corelib/tools/qlinkedlist.cpp
src/corelib/tools/qlinkedlist.h
src/corelib/tools/qlist.cpp
src/corelib/tools/qmap.cpp
src/corelib/tools/qrefcount.h
src/corelib/tools/qstring.cpp
src/corelib/tools/qstring.h
src/corelib/tools/qstringbuilder.h
src/corelib/tools/qvector.cpp
src/corelib/tools/qvector.h
tests/auto/corelib/tools/qvector/tst_qvector.cpp
tests/benchmarks/corelib/tools/qvector/qrawvector.h

@@@ -1302,9 -1302,9 +1302,9 @@@ QByteArray::QByteArray(const char *str
          d = const_cast<Data *>(&shared_empty.ba);
      } else {
          int len = qstrlen(str);
-         d = static_cast<Data *>(qMalloc(sizeof(Data) + len + 1));
+         d = static_cast<Data *>(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<Data *>(&shared_empty.ba);
      } else {
-         d = static_cast<Data *>(qMalloc(sizeof(Data) + size + 1));
+         d = static_cast<Data *>(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<Data *>(&shared_null.ba);
      } else {
-         d = static_cast<Data *>(qMalloc(sizeof(Data) + size + 1));
+         d = static_cast<Data *>(malloc(sizeof(Data) + size + 1));
          Q_CHECK_PTR(d);
 -        d->ref = 1;
 +        d->ref.initializeOwned();
          d->size = size;
          d->alloc = size;
          d->capacityReserved = false;
  
  QByteArray::QByteArray(int size, Qt::Initialization)
  {
-     d = static_cast<Data *>(qMalloc(sizeof(Data) + size + 1));
+     d = static_cast<Data *>(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<Data *>(qMalloc(sizeof(Data) + size + 1));
+         Data *x = static_cast<Data *>(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<Data *>(qMalloc(sizeof(Data) + alloc + 1));
+         Data *x = static_cast<Data *>(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<Data *>(&shared_empty.ba);
      } else {
-         x = static_cast<Data *>(qMalloc(sizeof(Data) + 1));
+         x = static_cast<Data *>(malloc(sizeof(Data) + 1));
          Q_CHECK_PTR(x);
 -        x->ref = 1;
 +        x->ref.initializeOwned();
          x->size = size;
          x->alloc = 0;
          x->capacityReserved = false;
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -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<Data *>(qMalloc(DataHeaderSize + alloc * sizeof(void *)));
+     Data* t = static_cast<Data *>(::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:
  QListData::Data *QListData::detach(int alloc)
  {
      Data *x = d;
-     Data* t = static_cast<Data *>(qMalloc(DataHeaderSize + alloc * sizeof(void *)));
+     Data* t = static_cast<Data *>(::malloc(DataHeaderSize + alloc * sizeof(void *)));
      Q_CHECK_PTR(t);
  
 -    t->ref = 1;
 +    t->ref.initializeOwned();
      t->sharable = true;
      t->alloc = alloc;
      if (!alloc) {
Simple merge
Simple merge
@@@ -1030,9 -1030,9 +1030,9 @@@ QString::QString(const QChar *unicode, 
      } else if (size <= 0) {
          d = const_cast<Data *>(&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<Data *>(&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<Data *>(&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;
  */
  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;
  */
  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<Data *>(qMalloc(sizeof(Data) + (alloc+1) * sizeof(QChar)));
+         Data *x = static_cast<Data *>(::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<Data *>(qMalloc(sizeof(Data) + (size+1) * sizeof(QChar)));
+         d = static_cast<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;
@@@ -7072,9 -7063,9 +7063,9 @@@ QString QString::fromRawData(const QCha
      } else if (!size) {
          x = const_cast<Data *>(&shared_empty.str);
      } else {
-         x = static_cast<Data *>(qMalloc(sizeof(Data) + sizeof(ushort)));
+         x = static_cast<Data *>(::malloc(sizeof(Data) + sizeof(ushort)));
          Q_CHECK_PTR(x);
 -        x->ref = 1;
 +        x->ref.initializeOwned();
          x->size = size;
          x->alloc = 0;
          x->capacityReserved = false;
Simple merge
Simple merge
Simple merge
Simple merge