This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Add Chunk::getSize, rework Chunk::getUsableSize
ClosedPublic

Authored by cryptoad on Mar 13 2018, 12:49 PM.

Details

Summary

Using getActuallyAllocatedSize from the Combined resulting in mediocre
compiled code, as the ClassId != 0 predicament was not propagated there,
resulting in additional branches and dead code. Move the logic in the frontend,
which results in better compiled code. Also I think it makes it slightly easier
to distinguish between the size the user requested, and the size that was
actually allocated by the allocator.

const a couple of things as well.

This has no functional impact.

Diff Detail

Event Timeline

cryptoad created this revision.Mar 13 2018, 12:49 PM
Herald added subscribers: Restricted Project, delcypher. · View Herald TranscriptMar 13 2018, 12:49 PM
alekseyshl accepted this revision.Mar 13 2018, 1:37 PM
alekseyshl added inline comments.
lib/scudo/scudo_allocator.cpp
95

Two more spaces indent

This revision is now accepted and ready to land.Mar 13 2018, 1:37 PM
cryptoad updated this revision to Diff 138257.Mar 13 2018, 2:06 PM

Indentation updated.

This revision was automatically updated to reflect the committed changes.