[PATCH] D60322: [LLVM-C] Begin to Expose A More General Binary Interface
Robert Widmann via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 5 13:41:49 PDT 2019
CodaFi marked an inline comment as done.
CodaFi added inline comments.
================
Comment at: llvm/include/llvm-c/Object.h:74
+ */
+LLVMMemoryBufferRef LLVMBinaryGetMemoryBuffer(LLVMBinaryRef BR);
+
----------------
CodaFi wrote:
> whitequark wrote:
> > Who owns the returned memory buffer?
> Good point, it's created from a MemoryBuffer Ref, so whoever owns the memory buffer that created this binary file owns the returned memory buffer. Deallocating the buffer returned from this function will also deallocate that buffer and cause all kinds of fun nosebats to take flight.
>
> I'll update the docs.
Ugh, no, that's wrong. It's a non-owning reference to the actually block of memory but it's still a pointer value that needs to be freed by the caller.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60322/new/
https://reviews.llvm.org/D60322
More information about the llvm-commits
mailing list