Page MenuHomePhabricator

[lsan] Factor pthread-specific assumptions out of thread tracking code
ClosedPublic

Authored by mcgrathr on Thu, Jan 23, 4:49 PM.

Details

Summary

This is a small refactoring to prepare for porting LSan to Fuchsia.
Factor out parts of lsan_thread.{cpp,h} that don't apply to Fuchsia.
Since existing supported systems are POSIX-based, the affected code
is moved to lsan_posix.{cpp.h}.

Diff Detail

Event Timeline

mcgrathr created this revision.Thu, Jan 23, 4:49 PM
vitalybuka accepted this revision.Fri, Jan 24, 1:41 AM
vitalybuka added inline comments.
compiler-rt/lib/lsan/lsan_posix.cpp
32

can you make it more consistent?
type name1;
type name2;
...

66

is this clang-formated?

compiler-rt/lib/lsan/lsan_posix.h
40

same about one per line

compiler-rt/lib/lsan/lsan_thread.h
29–30

maybe here and else
just
uptr stack_begin_ = 0;

This revision is now accepted and ready to land.Fri, Jan 24, 1:41 AM
mcgrathr updated this revision to Diff 240320.Fri, Jan 24, 4:17 PM
mcgrathr marked 2 inline comments as done.

Style changes to copied code, clang-format.

mcgrathr marked 3 inline comments as done.Fri, Jan 24, 4:23 PM

I've made the style changes you asked for and clang-format'd the files I touched. But note that all of these changes are to existing code that I just moved and left exactly as it had been and not anything I'd added. I erred on the side of leaving things alone rather than cleaning them up. I've now done the opposite as you asked, though it's not entirely consistent with the style and formatting of the existing code in the same directory. I'm happy to use whatever style choices you prefer, but it's easiest to do that when the codebase is consistent with those choices already.

compiler-rt/lib/lsan/lsan_posix.cpp
32

Consistent with what?
I'm happy to use whatever style rules you prefer.
But there's no sign that one-declaration-per-line is the prevailing sign in the existing codebase.

I'm changing this as you asked, but it was verbatim moved from the existing code in the other file and all the style choices were not mine.

66

It was moved verbatim from the old code.

This revision was automatically updated to reflect the committed changes.