Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3349)

Unified Diff: base/metrics/persistent_memory_allocator.cc

Issue 2970883002: Reduce memory usage in DelayedPersistentAllocation. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/persistent_memory_allocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/persistent_memory_allocator.cc
diff --git a/base/metrics/persistent_memory_allocator.cc b/base/metrics/persistent_memory_allocator.cc
index f569efa5fd353d9ea18141202a130091129665cd..b46dcfa3b5ff0a7972f7d854ed57f386350ac1fc 100644
--- a/base/metrics/persistent_memory_allocator.cc
+++ b/base/metrics/persistent_memory_allocator.cc
@@ -18,6 +18,7 @@
#include "base/memory/shared_memory.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
+#include "base/numerics/safe_conversions.h"
#include "base/threading/thread_restrictions.h"
namespace {
@@ -1123,8 +1124,8 @@ DelayedPersistentAllocation::DelayedPersistentAllocation(
bool make_iterable)
: allocator_(allocator),
type_(type),
- size_(size),
- offset_(offset),
+ size_(checked_cast<uint32_t>(size)),
+ offset_(checked_cast<uint32_t>(offset)),
make_iterable_(make_iterable),
reference_(ref) {
DCHECK(allocator_);
« no previous file with comments | « base/metrics/persistent_memory_allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698