From 88dcc7f5bb7388a9fb6e46597aca9894e9b3440f Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 24 Sep 2016 10:33:13 +0200 Subject: [PATCH] v8: fix -Wsign-compare warning in Zone::New() Use unsigned types for size calculations. Fixes a warning that was drowning out everything else because zone-inl.h is included in every source file: ../deps/v8/src/zone-inl.h: In member function 'void* v8::internal::Zone::New(int)': ../deps/v8/src/zone-inl.h:61:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (limit < position || size > limit - position) { PR-URL: https://github.com/nodejs/node-private/pull/62 Reviewed-By: Rod Vagg --- deps/v8/src/version.cc | 2 +- deps/v8/src/zone-inl.h | 10 +++++----- deps/v8/src/zone.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/deps/v8/src/version.cc b/deps/v8/src/version.cc index a918f344717ed0..0563eb03ccc30a 100644 --- a/deps/v8/src/version.cc +++ b/deps/v8/src/version.cc @@ -35,7 +35,7 @@ #define MAJOR_VERSION 3 #define MINOR_VERSION 14 #define BUILD_NUMBER 5 -#define PATCH_LEVEL 10 +#define PATCH_LEVEL 11 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) #define IS_CANDIDATE_VERSION 0 diff --git a/deps/v8/src/zone-inl.h b/deps/v8/src/zone-inl.h index 076556e1462fb8..910ce2f11ab09d 100644 --- a/deps/v8/src/zone-inl.h +++ b/deps/v8/src/zone-inl.h @@ -39,7 +39,7 @@ namespace v8 { namespace internal { -inline void* Zone::New(int size) { +inline void* Zone::New(size_t size) { ASSERT(scope_nesting_ > 0); // Round up the requested size to fit the alignment. size = RoundUp(size, kAlignment); @@ -72,7 +72,7 @@ inline void* Zone::New(int size) { template -T* Zone::NewArray(int length) { +T* Zone::NewArray(size_t length) { return static_cast(New(length * sizeof(T))); } @@ -98,18 +98,18 @@ ZoneSplayTree::~ZoneSplayTree() { void* ZoneObject::operator new(size_t size, Zone* zone) { - return zone->New(static_cast(size)); + return zone->New(size); } inline void* ZoneAllocationPolicy::New(size_t size) { ASSERT(zone_); - return zone_->New(static_cast(size)); + return zone_->New(size); } template void* ZoneList::operator new(size_t size, Zone* zone) { - return zone->New(static_cast(size)); + return zone->New(size); } diff --git a/deps/v8/src/zone.h b/deps/v8/src/zone.h index 01e887e779d703..47f6362aa280ca 100644 --- a/deps/v8/src/zone.h +++ b/deps/v8/src/zone.h @@ -68,10 +68,10 @@ class Zone { ~Zone() { DeleteKeptSegment(); } // Allocate 'size' bytes of memory in the Zone; expands the Zone by // allocating new segments of memory on demand using malloc(). - inline void* New(int size); + inline void* New(size_t size); template - inline T* NewArray(int length); + inline T* NewArray(size_t length); // Deletes all objects and free all memory allocated in the Zone. Keeps one // small (size <= kMaximumKeptSegmentSize) segment around if it finds one.