[PATCH] D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap

Hao Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 14 12:00:27 PDT 2019


wuhao5 added a comment.

> Can I ask why you want a weak reference to a block in the first place?  It seems basically useless — blocks can certainly appear in reference cycles, but I don't know why you'd ever try to break that cycle with the block instead of somewhere else.

The simplified version:

auto b = ^{

  if (check) {
    dispatch_after(queue, 1, b);
  } else {
   // done.
  }

};
dispatch_after(queue, 1, b);


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58514/new/

https://reviews.llvm.org/D58514





More information about the cfe-commits mailing list