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

Unified Diff: src/objects.cc

Issue 2856663002: Don't report array buffer allocations less than 1 Mb. (Closed)
Patch Set: Apply s/Big/Large/ in V8.ArrayBufferBigAllocations. Created 3 years, 7 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 | « src/counters.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index f40dc1e007d58b0ddc36cf753bdbedaf53fbb4c5..7c65a8ce244ad6ae0b37a337d236ca494e6e555a 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -19561,8 +19561,9 @@ bool JSArrayBuffer::SetupAllocatingData(Handle<JSArrayBuffer> array_buffer,
// Prevent creating array buffers when serializing.
DCHECK(!isolate->serializer_enabled());
if (allocated_length != 0) {
- isolate->counters()->array_buffer_big_allocations()->AddSample(
- ConvertToMb(allocated_length));
+ if (allocated_length >= MB)
+ isolate->counters()->array_buffer_big_allocations()->AddSample(
+ ConvertToMb(allocated_length));
if (initialize) {
data = isolate->array_buffer_allocator()->Allocate(allocated_length);
} else {
« no previous file with comments | « src/counters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698