This is an archive of the discontinued LLVM Phabricator instance.

Compact InputSectionData from 64 to 48 bytes
ClosedPublic

Authored by rafael on Sep 8 2016, 6:12 AM.

Details

Reviewers
ruiu

Diff Detail

Event Timeline

rafael updated this revision to Diff 70691.Sep 8 2016, 6:12 AM
rafael retitled this revision from to Compact InputSectionData from 64 to 48 bytes.
rafael updated this object.
rafael added a reviewer: ruiu.
rafael added a subscriber: llvm-commits.
ruiu added inline comments.Sep 8 2016, 6:20 PM
ELF/InputSection.h
62–63

My preference is to use std::vector instead of char * and size.

rafael added inline comments.Sep 9 2016, 4:57 AM
ELF/InputSection.h
62–63

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.

ruiu accepted this revision.Sep 9 2016, 10:46 AM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Sep 9 2016, 10:46 AM
silvas added a subscriber: silvas.Sep 9 2016, 10:46 AM
silvas added inline comments.
ELF/InputSection.h
62

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.

Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r281084.