tmp/tmpjhfgbekl/{from.md → to.md}
RENAMED
|
@@ -37,18 +37,18 @@ int foo_array[10][10];
|
|
| 37 |
|
| 38 |
[[carries_dependency]] struct foo* f(int i) {
|
| 39 |
return foo_head[i].load(memory_order_consume);
|
| 40 |
}
|
| 41 |
|
| 42 |
-
|
| 43 |
return kill_dependency(foo_array[*x][*y]);
|
| 44 |
}
|
| 45 |
|
| 46 |
/* Translation unit B. */
|
| 47 |
|
| 48 |
[[carries_dependency]] struct foo* f(int i);
|
| 49 |
-
|
| 50 |
|
| 51 |
int c = 3;
|
| 52 |
|
| 53 |
void h(int i) {
|
| 54 |
struct foo* p;
|
|
@@ -63,11 +63,11 @@ The `carries_dependency` attribute on function `f` means that the return
|
|
| 63 |
value carries a dependency out of `f`, so that the implementation need
|
| 64 |
not constrain ordering upon return from `f`. Implementations of `f` and
|
| 65 |
its caller may choose to preserve dependencies instead of emitting
|
| 66 |
hardware memory ordering instructions (a.k.a. fences).
|
| 67 |
|
| 68 |
-
Function `g`’s second
|
| 69 |
-
its first
|
| 70 |
-
carries a dependency into `g`, but its second call does not. The
|
| 71 |
implementation might need to insert a fence prior to the second call to
|
| 72 |
`g`.
|
| 73 |
|
|
|
|
| 37 |
|
| 38 |
[[carries_dependency]] struct foo* f(int i) {
|
| 39 |
return foo_head[i].load(memory_order_consume);
|
| 40 |
}
|
| 41 |
|
| 42 |
+
int g(int* x, int* y [[carries_dependency]]) {
|
| 43 |
return kill_dependency(foo_array[*x][*y]);
|
| 44 |
}
|
| 45 |
|
| 46 |
/* Translation unit B. */
|
| 47 |
|
| 48 |
[[carries_dependency]] struct foo* f(int i);
|
| 49 |
+
int g(int* x, int* y [[carries_dependency]]);
|
| 50 |
|
| 51 |
int c = 3;
|
| 52 |
|
| 53 |
void h(int i) {
|
| 54 |
struct foo* p;
|
|
|
|
| 63 |
value carries a dependency out of `f`, so that the implementation need
|
| 64 |
not constrain ordering upon return from `f`. Implementations of `f` and
|
| 65 |
its caller may choose to preserve dependencies instead of emitting
|
| 66 |
hardware memory ordering instructions (a.k.a. fences).
|
| 67 |
|
| 68 |
+
Function `g`’s second parameter has a `carries_dependency` attribute,
|
| 69 |
+
but its first parameter does not. Therefore, function `h`’s first call
|
| 70 |
+
to `g` carries a dependency into `g`, but its second call does not. The
|
| 71 |
implementation might need to insert a fence prior to the second call to
|
| 72 |
`g`.
|
| 73 |
|