Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d46c7a3

Browse files
authored
switched reactor to absl::flat_hash_map (#56845)
We don't need consistent pointers anymore since we are avoiding deleting objects to minimize time in the writer lock related pr with benchmarks: #56844 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I signed the [CLA]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style [testing the engine]: https://github.com/flutter/flutter/wiki/Testing-the-engine [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
1 parent c684de6 commit d46c7a3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

impeller/renderer/backend/gles/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,6 @@ impeller_component("gles") {
104104
"../../:renderer",
105105
"../../../shader_archive",
106106
"//flutter/fml",
107+
"//flutter/third_party/abseil-cpp/absl/container:flat_hash_map",
107108
]
108109
}

impeller/renderer/backend/gles/reactor_gles.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <memory>
1010
#include <vector>
1111

12+
#include "flutter/third_party/abseil-cpp/absl/container/flat_hash_map.h"
1213
#include "fml/closure.h"
1314
#include "impeller/base/thread.h"
1415
#include "impeller/renderer/backend/gles/handle_gles.h"
@@ -276,12 +277,10 @@ class ReactorGLES {
276277
std::map<std::thread::id, std::vector<Operation>> ops_ IPLR_GUARDED_BY(
277278
ops_mutex_);
278279

279-
// Make sure the container is one where erasing items during iteration doesn't
280-
// invalidate other iterators.
281-
using LiveHandles = std::unordered_map<const HandleGLES,
282-
LiveHandle,
283-
HandleGLES::Hash,
284-
HandleGLES::Equal>;
280+
using LiveHandles = absl::flat_hash_map<const HandleGLES,
281+
LiveHandle,
282+
HandleGLES::Hash,
283+
HandleGLES::Equal>;
285284
mutable RWMutex handles_mutex_;
286285
LiveHandles handles_ IPLR_GUARDED_BY(handles_mutex_);
287286
int32_t handles_to_collect_count_ IPLR_GUARDED_BY(handles_mutex_) = 0;

0 commit comments

Comments
 (0)