This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Slightly improve the handling of last block in a region
ClosedPublic

Authored by Chia-hungDuan on Mar 6 2023, 1:32 PM.

Details

Summary

Instead of going through all those trailing blocks, just count the
number and increase the counter at once.

Diff Detail

Event Timeline

Chia-hungDuan created this revision.Mar 6 2023, 1:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2023, 1:32 PM
Chia-hungDuan requested review of this revision.Mar 6 2023, 1:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2023, 1:32 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

Add more comments

cferris requested changes to this revision.Mar 7 2023, 1:47 PM

Are there tests that already cover the modified code?

compiler-rt/lib/scudo/standalone/release.h
499–500

Is this comment still valid? It doesn't seem like the code marks anything unless there are some trailing blocks.

This revision now requires changes to proceed.Mar 7 2023, 1:47 PM

Add more comment

compiler-rt/lib/scudo/standalone/release.h
499–500

Yes, we are still handling the trailing blocks (which is the "pretend" blocks mentioned in the comment). The difference is we don't iterate each trailing block.

Added more comments

Are there tests that already cover the modified code?

Yes, our tests have covered the handling of the last block in the region already.

cferris accepted this revision.Mar 7 2023, 2:28 PM

LGTM

This revision is now accepted and ready to land.Mar 7 2023, 2:28 PM