[llvm] r211595 - Pass a unique_ptr<MemoryBuffer> to the constructors in the Binary hierarchy.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Jul 4 18:59:39 PDT 2014


> Where? *All* current uses on ToT seem to mmap their own private MemoryBuffer
> and un-mmap it immediately afterwards.

Where? Show an strace where an **ObjectFile** is reopened.

With object files we don't have the complexities of a source manager.
There are two reasonable ownership models: It owns the buffer and it
don't own the buffer. Not owning it might be more convenient,, I am
looking into it. A reference count makes no sense for the uses we
have.

If the complexities of a source manager require a reference count to
avoid duplicating read and stats, then it should hold a list of
std::shared_ptr, or a list of a RefCountedMemoryBuffer. Changing how
ObjectFile works because a *source* manager wants to refcount buffers
is not OK.

Cheers,
Rafael



More information about the llvm-commits mailing list