Skip to content

Commit

Permalink
buffer: use v8::TypedArray::kMaxLength as buffer::kMaxLength
Browse files Browse the repository at this point in the history
This was added in v8 6.2, looks like a safe replacement for
our own buffer::kMaxLength.

PR-URL: #19738
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
joyeecheung authored and targos committed Apr 4, 2018
1 parent 0127712 commit 0bd78dc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/node_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ extern bool zero_fill_all_buffers;

namespace Buffer {

static const unsigned int kMaxLength =
sizeof(int32_t) == sizeof(intptr_t) ? 0x3fffffff : 0x7fffffff;
static const unsigned int kMaxLength = v8::TypedArray::kMaxLength;

typedef void (*FreeCallback)(char* data, void* hint);

Expand Down

0 comments on commit 0bd78dc

Please sign in to comment.