buffer: add comment explaining buffer alignment
Avoids alignment issues (unaligned loads/stores) on ARM. Originally
added in commit 285d8c6
.
Fixes #3030.
This commit is contained in:
Родитель
2a8c5ddc46
Коммит
cf6acf2a1a
|
@ -199,8 +199,8 @@ function Buffer(subject, encoding, offset) {
|
|||
if (!pool || pool.length - pool.used < this.length) allocPool();
|
||||
this.parent = pool;
|
||||
this.offset = pool.used;
|
||||
pool.used += this.length;
|
||||
if (pool.used & 7) pool.used = (pool.used + 8) & ~7;
|
||||
// Align on 8 byte boundary to avoid alignment issues on ARM.
|
||||
pool.used = (pool.used + this.length + 7) & ~7;
|
||||
|
||||
} else {
|
||||
// Zero-length buffer
|
||||
|
|
Загрузка…
Ссылка в новой задаче