Calm down, the storage for 'l' is thrown away, but its effects remain.TakeLock l(&lock);No, it's optimized out. gcc notices that &lock doesn't change and that
do_something();
do_something_else();
First of all, that extra TakeLock object chews up stack, at least 4 or
8 bytes of it, depending on your word size.
'l' never escapes the function.
"l" that propects critical section gets thrown away???
What is theIt's very expensive, you can't use it by accident.
name of the filesystem you ported? I mean, I need to know so I don't
use it by accident.