Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
NO_UNIQUE_ADDRESS V8ExternalMemoryAccounterBase external_memory_accounter_;
Why is this `NO_UNIQUE_ADDRESS`? Maybe a comment explaining that would be useful?
mutable intptr_t externally_allocated_memory_;
It doesn't need to be `mutable` if `UpdateMemoryUsage` is not `const`. Right?
// GPU Memory Management
mutable intptr_t externally_allocated_memory_;
Remove.
externally_allocated_memory_(0) {
Remove.
// TODO(fserb): Merge this with HTMLCanvasElement::UpdateMemoryUsage
And there was a TODO this whole time!
Thanks for taking care of it!
OffscreenCanvas::~OffscreenCanvas() = default;
Remove? There's no need to explicitly declare and define a default constructor, is there? Is this because it would otherwise trigger the compiler check preventing large functions to be inlined?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
NO_UNIQUE_ADDRESS V8ExternalMemoryAccounterBase external_memory_accounter_;
Why is this `NO_UNIQUE_ADDRESS`? Maybe a comment explaining that would be useful?
Added a comment, this is so that dcheck only things don't make the object bigger in release builds.
It doesn't need to be `mutable` if `UpdateMemoryUsage` is not `const`. Right?
Done
// GPU Memory Management
mutable intptr_t externally_allocated_memory_;
Etienne Pierre-DorayRemove.
Done
externally_allocated_memory_(0) {
Etienne Pierre-DorayRemove.
Done
Remove? There's no need to explicitly declare and define a default constructor, is there? Is this because it would otherwise trigger the compiler check preventing large functions to be inlined?
I thought it would trip for virtual methods, but apparently not.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
NO_UNIQUE_ADDRESS V8ExternalMemoryAccounterBase external_memory_accounter_;
Etienne Pierre-DorayWhy is this `NO_UNIQUE_ADDRESS`? Maybe a comment explaining that would be useful?
Added a comment, this is so that dcheck only things don't make the object bigger in release builds.
Ha, make sense. I code-searched wrong and thought we were using `V8ExternalMemoryAccounter`, which would consume memory even in release builds.
Which makes me think (idea for a follow-up). Why aren't we not using `V8ExternalMemoryAccounter`? Using a base class here is strange. Using the child class would hide the `NO_UNIQUE_ADDRESS` complexity and delta calculation away. The fact that users of the class need to use `NO_UNIQUE_ADDRESS` breaks encapsulation. Users need to know that the class has no members and if that ever changes, all users will need to be updated or else you'll have a bug. Then, all of the fuss around not being allowed to increase the memory size while GC is disabled is a concern all users of `V8ExternalMemoryAccounter` should have. Why not centralize all of this in one place?
~OffscreenCanvas() override = default;
Still. This is not needed either. Isn't it? The compiler automatically generates a default constructor if you don't provide one. See for instance: https://godbolt.org/z/9aaMdTc1n
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |