Back to index
|class||nsFastLoadPtr< T >|
|PR_EXPORT_DATA (nsIFastLoadService *) gFastLoadService_|
|Mozilla FastLoad file object pointer template type. |
Mozilla FastLoad file object pointer template type.
Use nsFastLoadPtr<T> rather than nsCOMPtr<T> when declaring a strong XPCOM ref member of a data structure that's conditionally loaded at application startup. You must be willing to tolerate the null mRawPtr test on every dereference of this member pointer, or else copy it to a local to optimize away the cost. nsFastLoadPtr is a template class, so we don't want a class static service pointer member declared in nsFastLoadPtr, above. Plus, we need special declaration magic to export data across DLL/DSO boundaries. So we use an old-fashioned global variable that refers weakly to the one true FastLoad service. This pointer is maintained by that singleton's ctor and dtor.