Skip to content

Commit

Permalink
deps: V8: use ATOMIC_VAR_INIT instead of std::atomic_init
Browse files Browse the repository at this point in the history
`std::atomic_init<size_t>` is not implemented in all platforms.

* pragma to ignore `-Wbraced-scalar-init`

Backport-PR-URL: #28005
PR-URL: #27375
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
refack authored and targos committed Jun 4, 2019
1 parent c08d94b commit b411114
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.8',
'v8_embedder_string': '-node.9',

##### V8 defaults for Node.js #####

Expand Down
9 changes: 8 additions & 1 deletion deps/v8/src/wasm/module-compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@ class CompilationUnitQueues {
queues_[task_id].next_steal_task_id_ = next_task_id(task_id);
}
for (auto& atomic_counter : num_units_) {
std::atomic_init(&atomic_counter, size_t{0});
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wbraced-scalar-init"
#endif
atomic_counter = ATOMIC_VAR_INIT(0);
#ifdef __clang__
#pragma clang diagnostic pop
#endif
}
}

Expand Down

0 comments on commit b411114

Please sign in to comment.