buffer: fix pool offset adjustment
If the Buffer allocation isn't a slice then there's no need to adjust the pool offset after realloc'ing the space available. Fixes: 6462519 "buffer, doc: misc. fix and cleanup"
This commit is contained in:
parent
77f35861d0
commit
c6fd2c5e95
@ -84,6 +84,8 @@ function Buffer(subject, encoding) {
|
|||||||
var prevLen = this.length;
|
var prevLen = this.length;
|
||||||
this.length = len;
|
this.length = len;
|
||||||
truncate(this, this.length);
|
truncate(this, this.length);
|
||||||
|
// Only need to readjust the poolOffset if the allocation is a slice.
|
||||||
|
if (this.parent != undefined)
|
||||||
poolOffset -= (prevLen - len);
|
poolOffset -= (prevLen - len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user