Qt 4.8
Functions
QtSharedPointer Namespace Reference

Functions

Q_CORE_EXPORT void internalSafetyCheckAdd (const volatile void *)
 
Q_AUTOTEST_EXPORT void internalSafetyCheckCleanCheck ()
 
Q_CORE_EXPORT void internalSafetyCheckRemove (const volatile void *)
 

Function Documentation

◆ internalSafetyCheckAdd()

void QtSharedPointer::internalSafetyCheckAdd ( const volatile void *  )
Warning
This function is not part of the public interface.

Definition at line 1523 of file qsharedpointer.cpp.

1524 {
1525  // Qt 4.5 compatibility
1526  // this function is broken by design, so it was replaced with internalSafetyCheckAdd2
1527  //
1528  // it's broken because we tracked the pointers added and
1529  // removed from QSharedPointer, converted to void*.
1530  // That is, this is supposed to track the "top-of-object" pointer in
1531  // case of multiple inheritance.
1532  //
1533  // However, it doesn't work well in some compilers:
1534  // if you create an object with a class of type A and the last reference
1535  // is dropped of type B, then the value passed to internalSafetyCheckRemove could
1536  // be different than was added. That would leave dangling addresses.
1537  //
1538  // So instead, we track the pointer by the d-pointer instead.
1539 }

◆ internalSafetyCheckCleanCheck()

void QtSharedPointer::internalSafetyCheckCleanCheck ( )
Warning
This function is not part of the public interface. Called by the QSharedPointer autotest

Definition at line 1618 of file qsharedpointer.cpp.

1619 {
1620 # ifdef QT_BUILD_INTERNAL
1621  KnownPointers *const kp = knownPointers();
1622  Q_ASSERT_X(kp, "internalSafetyCheckSelfCheck()", "Called after global statics deletion!");
1623 
1624  if (kp->dPointers.size() != kp->dataPointers.size())
1625  qFatal("Internal consistency error: the number of pointers is not equal!");
1626 
1627  if (!kp->dPointers.isEmpty())
1628  qFatal("Pointer cleaning failed: %d entries remaining", kp->dPointers.size());
1629 # endif
1630 }
Q_CORE_EXPORT void qFatal(const char *,...)
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837

◆ internalSafetyCheckRemove()

void QtSharedPointer::internalSafetyCheckRemove ( const volatile void *  )
Warning
This function is not part of the public interface.

Definition at line 1544 of file qsharedpointer.cpp.

1545 {
1546  // Qt 4.5 compatibility
1547  // see comments above
1548 }