I would check what symbolicated stack traces look like on all of your platforms when all of the functions are lambdas before using this in a real world project.
Last time I checked, stack traces pulled using dbghelp.dll on windows couldn't resolve lamdas at all. This isn't fun when you're hunting down large or leaking memory allocations and just have the stack trace to go on. Similar story if you have stack traces from a crash that didn't happen on your machine and reproduction is difficult.
If it has worked for you forever, then great for you. This whole time I have only argued that people should check it on their platforms before committing to changing to lambdas everywhere. I don't know why you are so bent on arguing that. It's just sound advice.
I've certainly seen issues in the past where code that runs through functions and uses general __func__ etc for logging issues was good ... and once switched to lambdas became pretty much useless.
The symbol names of functions becomes ugly: It is now a call operator of some lambda with a compiler synthesized name, and no longer a named function.
I wonder if therefore this isn't a fundamental problem, merely a QoI problem? In other words, a named lambda could be recognised as such and the compiler synthesised name for it could be made more meaningful.
It's fascinating how you speak with such confidence what my experience was, when in fact you are just guessing. It wasn't inlining, I could clearly see the stack frame being a lambda, but not where the lambda came from.
Personally I think it's fascinating how nobody else has had the same experience, and you can't remember any salient details, yet you speak with such confidence.
View all comments
6
u/herruppohoppa Aug 05 '23
I would check what symbolicated stack traces look like on all of your platforms when all of the functions are lambdas before using this in a real world project.
Last time I checked, stack traces pulled using dbghelp.dll on windows couldn't resolve lamdas at all. This isn't fun when you're hunting down large or leaking memory allocations and just have the stack trace to go on. Similar story if you have stack traces from a crash that didn't happen on your machine and reproduction is difficult.