This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] s/TestOnlyInit/Init for the allocator ByteMap (NFC)
ClosedPublic

Authored by cryptoad on May 3 2018, 1:47 PM.

Details

Summary

The TestOnlyInit function of {Flat,TwoLevel}ByteMap seems to be a misnomer
since the function is used outside of tests as well, namely in
SizeClassAllocator32::Init. Rename it to Init and update the callers.

Diff Detail

Event Timeline

cryptoad created this revision.May 3 2018, 1:47 PM
Herald added subscribers: Restricted Project, delcypher, kubamracek. · View Herald TranscriptMay 3 2018, 1:47 PM
vitalybuka accepted this revision.May 7 2018, 11:20 AM
vitalybuka added inline comments.
lib/sanitizer_common/sanitizer_allocator_bytemap.h
21

I'd call it Reset().

This revision is now accepted and ready to land.May 7 2018, 11:20 AM
cryptoad added inline comments.May 7 2018, 11:33 AM
lib/sanitizer_common/sanitizer_allocator_bytemap.h
21

I feel like Reset could be confusing as it could lead someone to think it can be called for more purposes than initialization.

vitalybuka added inline comments.May 7 2018, 11:47 AM
lib/sanitizer_common/sanitizer_allocator_bytemap.h
21

Up to you, but I see no issues if it called for more purposes.

This revision was automatically updated to reflect the committed changes.