Skip to content

Commit

Permalink
Provide an estimate of EngineLayer memory usage to the Dart GC (flutt…
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-simmons authored Oct 18, 2018
1 parent 2511dec commit c176244
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/ui/painting/engine_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ namespace blink {

EngineLayer::~EngineLayer() = default;

size_t EngineLayer::GetAllocationSize() {
// Provide an approximation of the total memory impact of this object to the
// Dart GC. The ContainerLayer may hold references to a tree of other layers,
// which in turn may contain Skia objects.
return 3000;
};

IMPLEMENT_WRAPPERTYPEINFO(ui, EngineLayer);

#define FOR_EACH_BINDING(V) // nothing to bind
Expand Down
3 changes: 3 additions & 0 deletions lib/ui/painting/engine_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class EngineLayer : public RefCountedDartWrappable<EngineLayer> {

public:
~EngineLayer() override;

size_t GetAllocationSize() override;

static fml::RefPtr<EngineLayer> MakeRetained(
std::shared_ptr<flow::ContainerLayer> layer) {
return fml::MakeRefCounted<EngineLayer>(layer);
Expand Down

0 comments on commit c176244

Please sign in to comment.