buffer: fix buffer alignment restriction
Pull Request check-list
-
Does make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass with this change (including linting)? -
Is the commit message formatted according to CONTRIBUTING.md? -
If this change fixes a bug (or a performance problem), is a regression test (or a benchmark) included?
Affected core subsystem(s)
buffer
Description of change
@addaleax recently reported that recent phantom weakness changes (ebbbc5a7) to buffer break node-ffi
and possibly other modules that use create unaligned buffers.
It turns out there is a simpler solution possible that doesn't introduce an alignment restriction. This also eliminates the need for Node-core to reserve the first internal field on buffers.
Ref: https://github.com/nodejs/node/pull/5204 R=@bnoordhuis, @trevnorris
Marking with dont-land-on-*
as the pre-requisite change is also marked likewise.