- User Since
- Oct 21 2020, 11:25 AM (6 w, 1 d)
Tue, Nov 10
Fri, Nov 6
Oct 30 2020
Satisfy clang-format bot, at the cost of formatting a few adjacent lines.
Oct 29 2020
Oct 22 2020
Move the check to cover the atomic case as well.
We do not actually support allocation failure for a lot of things around blocks. I don't think the copy-helper functions even have a way to propagate out a failure in copying a field. I have never seen any code in the wild that would handle Block_copy returning a null pointer. Effectively it is assumed to not happen.
Oct 21 2020
One downside of that approach is performance. It's somewhat idiosyncratic, but I work on codebases that use blocks heavily in performance-sensitive paths. Typically, the blocks are never copied (they don't escape) and are expected to be inlined. Any implicit heap allocations added by the compiler would have an undesirable performance cost, and would likely also hinder inlining. For those codebases, I would much prefer to be prompted to refactor the code to avoid the self-capture. I suppose this could be implemented as a warning, perhaps off by default.