boostorg / stacktrace

C++ library for storing and printing backtraces.
https://boost.org/libs/stacktrace
422 stars 69 forks source link

Don't initialize COM #123

Closed AlexGuteniev closed 1 year ago

AlexGuteniev commented 2 years ago

Resolve #121

See the documentation:

You don't need to call CoInitialize, CoInitializeEx, or OleInitialize to use this function and interfaces obtained by it.

Even if DIA support is implemented, there's a way to avoid CoInitializeEx for DIA too.

AlexGuteniev commented 2 years ago

BTW if DbgEng interfaces were COM apartment aware, this comment is wrong:

        // COINIT_MULTITHREADED means that we must serialize access to the objects manually.
        // This is the fastest way to work.

COINIT_MULTITHREADED does not always mean better perf (in particular it is worse when the underlying server is apartment-threaded), and does not ever mean that the synchronization to call COM methods is necessary (it rather means that the synchronization often is needed inside COM methods, as they are called from arbitrary threads).

apolukhin commented 1 year ago

Many many thanks for the great news and the PR!