[llvm] r216071 - Quick fix for an use after free.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Aug 20 22:00:56 PDT 2014


On 20 August 2014 19:37, Lang Hames <lhames at gmail.com> wrote:
> Hi Rafael,
>
> The ExecutionEngine already owns the LL module, right? I think we should
> actually make addObjectFile an owning operation too, for consistency.

What do you think of the attached patch?

> Side note: In the long term I'd love to move to a world where
> ExecutionEngine and its subclasses are non-owning and we provide convenience
> classes to automatically manage ownership for clients with simple use cases.
> A lot of JIT clients probably know better than ExecutionEngine how they want
> their memory managed, and for them automatic ownership is just a
> straightjacket.

Yes. In general I feel that having Foo own Bar was more useful when
memory management in C++ was manual. You only had to remember to
delete Foo and Bar would go away. With std::unique_ptr and std::move
most of that advantage goes away.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 4018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140821/02b420ed/attachment.bin>


More information about the llvm-commits mailing list