Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 2f884135 authored by Chia-I Wu's avatar Chia-I Wu
Browse files

surfaceflinger: simplify memory management for layerproto

Use std::vector<Layer> instead of a tree of std::unique_ptr<Layer>
to manage layers.  This significantly reduces the number of
allocations, and more importantly, we can get rid of "new" in
generateLayer.  Because there is no "new", it is easier to reason
that there is no leaked layer.

We still keep the pointers to top-level layers in
LayerTree::topLevelLayers.  But AFAICT, we probably don't need it
after all.

Test: dumpsys, winscope trace
Change-Id: I302c9115ab025b69e9ea05f4bcd759ed3ee4a8eb
parent b4e0a834
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment