diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-03-01 17:17:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-01 17:17:59 -0500 |
commit | ad21210edd5aabdeebe70809672b4224cc6f41c9 (patch) | |
tree | df6e499a4c3adde676cf029b13cbcc03a2720924 /core/shared_queue_test.js | |
parent | c3661e9f0731c8e6d2952de23eaeaaa1dc6ca4da (diff) |
perf: use subarray instead of slice in dispatch minimal (#4180)
Diffstat (limited to 'core/shared_queue_test.js')
-rw-r--r-- | core/shared_queue_test.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/shared_queue_test.js b/core/shared_queue_test.js index 37bc9a28a..7821f93a6 100644 --- a/core/shared_queue_test.js +++ b/core/shared_queue_test.js @@ -28,10 +28,14 @@ function main() { const h = q.head(); assert(h > 0); + // This record's len is not divisble by + // 4 so after pushing it to the queue, + // next record offset should be aligned to 4. let r = new Uint8Array([1, 2, 3, 4, 5]); const len = r.byteLength + h; assert(q.push(1, r)); - assert(q.head() == len); + // Record should be aligned to 4 bytes + assert(q.head() == len + 3); r = new Uint8Array([6, 7]); assert(q.push(1, r)); |