fix: bugprone-narrowing-conversions warnings in NativeImage (#44740)
* fix: bugprone-narrowing-conversions warning in NativeImage::memory_usage_ - fix signed / unsigned math by using base/numerics/safe_conversions - make memory_usage_ an int64_t so it can safely take the size_t returned by computeByteSize()
This commit is contained in:
parent
b78e06974e
commit
9dc7ac48fe
2 changed files with 13 additions and 14 deletions
|
@ -140,7 +140,7 @@ class NativeImage final : public gin::Wrappable<NativeImage> {
|
|||
gfx::Image image_;
|
||||
|
||||
raw_ptr<v8::Isolate> isolate_;
|
||||
int32_t memory_usage_ = 0;
|
||||
int64_t memory_usage_ = 0;
|
||||
};
|
||||
|
||||
} // namespace electron::api
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue