Skip to content
Commit 41828e7e authored by Fangrui Song's avatar Fangrui Song
Browse files

[Common] Threads: use function_ref instead of std::function

The benefits are:

a) Performance (very minor): it removes a heap allocation of the std::function constructor (template<class F> function(F f))
b) Clarity: it suggests that the callable's lifetime should end after the callee returns. Such callback is widely used in llvm. lld also uses it a lot.

Reviewers: ruiu, rnk, pcc

Reviewed By: ruiu

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D54813

llvm-svn: 347620
parent 3bd24901
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment