On Feb 12, 2014, at 2:21 PM, Rafael Ávila de Espíndola 
<[email protected]> wrote:

> 
> 
> ================
> Comment at: include/clang/Basic/FileManager.h:122
> @@ -121,2 +121,3 @@
> class FileManager : public RefCountedBase<FileManager> {
> +  IntrusiveRefCntPtr<AbstractFileSystem> FS;
>   FileSystemOptions FileSystemOpts;
> ----------------
> Why is the reference count necessary? Given its nature I would expect the FS 
> to outlive the file manger, in which case the FileManager could have just a 
> pointer to the FileSystem.


The FS is likely to get shared among a number of FileManagers in different 
compiler instances within a thread. Yes, we could try to establish and maintain 
relationships among these, but it’s simpler and costs us effectively nothing to 
make this ref-counted.

        - Doug


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to