Page MenuHomePhabricator

Fix hang in global static initialization

Authored by amccarth on Nov 30 2015, 1:57 PM.



A previous patch introduced a global static ConstString instance. On Windows, this results in a hang because constructing the string pool appears to depend on other globals which haven't yet been initialized.

All other instances of static ConstStrings I could find were function static, so I modified the code to use a static function.

Diff Detail

Event Timeline

amccarth updated this revision to Diff 41433.Nov 30 2015, 1:57 PM
amccarth retitled this revision from to Fix hang in global static initialization.
amccarth updated this object.
amccarth added reviewers: EwanCrawford, zturner.
amccarth added a subscriber: lldb-commits.
zturner added inline comments.Nov 30 2015, 2:00 PM

I wonder about returning this by reference. It seems like by convention we usually pass ConstStrings around by value.

amccarth added inline comments.Nov 30 2015, 2:14 PM

I was following the pattern used elsewhere, like Breakpoint::BreakpointEventData::GetFlavorString.

zturner accepted this revision.Nov 30 2015, 2:16 PM
zturner edited edge metadata.

Ahh ok if there's already precedent for returning by reference then it's fine.

This revision is now accepted and ready to land.Nov 30 2015, 2:16 PM
This revision was automatically updated to reflect the committed changes.
EwanCrawford edited edge metadata.Dec 1 2015, 1:04 AM

Thanks for fixing this Adrian