forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1872555: Transfer can only realloc when the jemalloc arena is kno…
…wn. r=sfink `ArrayBufferObject::copyAndDetachRealloc()` calls `ReallocateArrayBufferContents` to realloc the source buffer into `ArrayBufferContentsArena`. This is only valid when the source buffer was also created in `ArrayBufferContentsArena`. To track if the ArrayBuffer contents were allocated in `ArrayBufferContentsArena`, split `BufferKind::MALLOCED` into `MALLOCED_ARRAYBUFFER_CONTENTS_ARENA` and `MALLOCED_UNKNOWN_ARENA`. Differential Revision: https://phabricator.services.mozilla.com/D197492
- Loading branch information
Showing
5 changed files
with
80 additions
and
52 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
js/src/jit-test/tests/typedarray/arraybuffer-transfer-unknown-arena.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const headerSize = 8; | ||
const undefinedSize = 8; | ||
|
||
let source = serialize(undefined).arraybuffer | ||
assertEq(source.detached, false); | ||
assertEq(source.byteLength, headerSize + undefinedSize); | ||
|
||
let target = source.transfer(128); | ||
assertEq(source.detached, true); | ||
assertEq(source.byteLength, 0); | ||
assertEq(target.detached, false); | ||
assertEq(target.byteLength, 128); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters