Skip to content

Commit

Permalink
Snippet for dispatch_data_apply fixed
Browse files Browse the repository at this point in the history
Missed block return type lead to compile time error.
  • Loading branch information
valeriyvan committed Dec 4, 2014
1 parent d88364d commit 66b2fcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 2013-07-07-low-level-concurrency-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ One relatively unique property of `dispatch_data_t` is that it can be backed by

the data object `c` will *not* copy `a` and `b` into a single, larger memory region. Instead it will simply retain both `a` and `b`. You can then traverse the memory regions represented by `c` with `dispatch_data_apply`:

dispatch_data_apply(c, ^(dispatch_data_t region, size_t offset, const void *buffer, size_t size) {
dispatch_data_apply(c, ^bool(dispatch_data_t region, size_t offset, const void *buffer, size_t size) {
fprintf(stderr, "region with offset %zu, size %zu\n", offset, size);
return true;
});
Expand Down

0 comments on commit 66b2fcc

Please sign in to comment.