[PATCH] D61599: [Support] Reverted r357058 and r351916, MemoryBlock class now exposes its allocated size instead of requested size.

Machiel van Hooren via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 03:43:59 PDT 2019


mvhooren updated this revision to Diff 198615.
mvhooren retitled this revision from "[Support] MemoryBlock objects now expose their allocated size in addition to the requested size." to "[Support] Reverted r357058 and r351916, MemoryBlock class now exposes its allocated size instead of requested size.".
mvhooren edited the summary of this revision.
mvhooren added a comment.

Reverted changes from revisions r357058 and r351916 as discussed. Updated the InMemoryBuffer in FileOutputBuffer.cpp to track the requested buffer size.
The Size member of MemoryBlock and OwningMemoryBlock was renamed to AllocatedSize in order to provide a hint that the allocated size may be different than the requested size. I also added some comments to further clarify this point.
I have checked all the call sites of MemoryBlock::size() and as far as I can tell, FileOutputBuffer is the only location where wrong assumptions were made about the size.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61599/new/

https://reviews.llvm.org/D61599

Files:
  include/llvm/Support/Memory.h
  lib/ExecutionEngine/JITLink/JITLink.cpp
  lib/ExecutionEngine/SectionMemoryManager.cpp
  lib/Support/FileOutputBuffer.cpp
  lib/Support/Memory.cpp
  lib/Support/Unix/Memory.inc
  lib/Support/Windows/Memory.inc
  tools/llvm-rtdyld/llvm-rtdyld.cpp
  unittests/Support/MemoryTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61599.198615.patch
Type: text/x-patch
Size: 20728 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190508/ae1cc822/attachment.bin>


More information about the llvm-commits mailing list