[PATCH] D30178: Do not leak OpenedHandles

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 14:38:46 PST 2017


vsk added a comment.

In https://reviews.llvm.org/D30178#681805, @marsupial wrote:

> Believe it is fixed in my patch: allocating into a //std::unique_ptr// which should auto-destruct the contents on exit.
>  The ManagedStatic docs seems to talk about startup time, but I find it hard to believe that allocating space for a single pointer would be slower than the three it allocates plus other internals.


It's not only about the space the unique_ptr would occupy -- startup times are impacted by global constructors. The advantage of ManagedStatic is that you don't pay the construction cost until you need to.

> I'd prefer to use it in the patch I have as that addresses a more severe problem and this causes conflict resolution on my end.

Ok, well it sounds like you'd like to take care of it, so this patch will lgtm once the OpenedHandles initialization issues are fixed.


Repository:
  rL LLVM

https://reviews.llvm.org/D30178





More information about the llvm-commits mailing list