[PATCH] D24342: Compact InputSectionData from 64 to 48 bytes

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 10:46:50 PDT 2016


silvas added a subscriber: silvas.

================
Comment at: ELF/InputSection.h:62
@@ +61,3 @@
+  // If a section is compressed, this has the uncompressed section data.
+  std::unique_ptr<char> UncompressedData;
+  size_t UncompressedDataSize = 0;
----------------
rafael wrote:
> ruiu wrote:
> > My preference is to use std::vector instead of char * and size.
> std::vector is still 3 pointers.
> 
> What I want to do next is to always have a valid StringRef (or ArrayRef) with the data. Initially it points to the mmaped file. After decompression it points to UncompressedData and UncompressedDataSize can be removed.
Orthogonal to Rui's concerns, this needs to be `std::unique_ptr<char[]>` for `operator delete[]` to be called. Otherwise, it will delete just a single char and corrupt the heap.


https://reviews.llvm.org/D24342





More information about the llvm-commits mailing list