Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsFastLoadPtr.h File Reference
#include "nsCOMPtr.h"
#include "nsIFastLoadService.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  nsFastLoadPtr< T >


 PR_EXPORT_DATA (nsIFastLoadService *) gFastLoadService_
 Mozilla FastLoad file object pointer template type.

Function Documentation

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.