commit | 13f12c8d2783426248a4d5f77681c0947bc46b48 | [log] [tgz] |
---|---|---|
author | Jeremy Roman <jbroman@chromium.org> | Fri Dec 07 22:57:51 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Dec 07 22:57:51 2018 |
tree | 207e9b890bc15bfc77e3f6f41c94e1f90df8ba3b | |
parent | 36323dd74afffbc93b9e5448d024d8390b20be3f [diff] |
heap: Use standard C++ <atomic> to implement cross-thread pointers to PersistentNode. Since this causes the type of the pointer for this case to change from PersistentNode* to std::atomic<PersistentNode*>, this makes the strategy of choosing whether to do atomic operations or not using an |if| statement invalid, as that requires that the code in both branches be *valid* (even if it would get optimized out later) -- since we don't have C++17's constexpr if. As a result, those parts of PersistentBase which manipulate this pointer in that way are moved into a member which encapsulates that logic -- PersistentNodePtr for the single-thread case, and CrossThreadPersistentNodePtr for the cross-thread case. These expose a compatible interface and prevent this compiler error. Bug: 736037 Change-Id: I00ba2fb76e95d1c00be3931990361ffb374fc231 Reviewed-on: https://chromium-review.googlesource.com/c/1355840 Reviewed-by: Keishi Hattori <keishi@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/master@{#614857}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .