summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydatapointer.h
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-01-05 16:29:42 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-06 21:22:07 +0100
commitd91b4f0b13926a0861d7e172f14437d20d06332e (patch)
tree42448bee7631763d45daeccc11090ca618cc982c /src/corelib/tools/qarraydatapointer.h
parent3d61c5ca8f00b489435d5bea776b4a4c97c39793 (diff)
Remove shared_empty and unsharable_empty from API
They still exist and help avoid allocation of "empty" array headers, but they're no longer part of the public API, thus reducing relocatable symbols and relocations in inline code. This means an extra non-inline call on QArrayDataPointer::clear and setSharable operations, which are (expensive) detaching operations, anyway. Change-Id: Iea804e5ddc8af55ebc0951ca17a7a4e8401abc55 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qarraydatapointer.h')
-rw-r--r--src/corelib/tools/qarraydatapointer.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index e42d146c58..c03e2ef849 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -115,12 +115,7 @@ public:
void setSharable(bool sharable)
{
if (d->alloc == 0 && d->size == 0) {
- Q_ASSERT(Data::sharedNull() == d
- || Data::sharedEmpty() == d
- || Data::unsharableEmpty() == d);
- d = sharable
- ? Data::sharedEmpty()
- : Data::unsharableEmpty();
+ d = Data::allocate(0, false, sharable);
return;
}
@@ -136,7 +131,7 @@ public:
void clear()
{
QArrayDataPointer tmp(d);
- d = Data::sharedEmpty();
+ d = Data::allocate(0);
}
bool detach()