Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Allow implementations to round up max byte lengths - #25

Merged
syg merged 1 commit into
masterfrom
allow-maxbytelength-rounding
Feb 23, 2021
Merged

syg merged 1 commit into
masterfrom
allow-maxbytelength-rounding

Conversation

@syg

@syg syg commented Feb 23, 2021

Copy link
Copy Markdown
Collaborator

Unlike allowing implementations to round byte lengths, the only harm I see in allowing implementations to round max byte length I see is giving more bits to fingerprinting.

I'm leaning towards making this tradeoff and allowing implementations to round.

To recover some bits of fingerprinting and possible interop concerns, this PR requires that any rounding up, if performed, must result in a power of 2.

Closes #18, #23

@syg
syg requested a review from marjakh February 23, 2021 01:01
@marjakh

marjakh commented Feb 23, 2021

Copy link
Copy Markdown

lgtm, but looks like I'm not allowed to mark this as reviewed

@marjakh marjakh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, now I can approve it!

Comment thread spec.html
1. <ins>Append [[ArrayBufferByteLengthData]] and [[ArrayBufferMaxByteLength]] to _slots_.</ins>
1. <ins>Let _maxByteLength_ be an implementation-defined value that is &ge; _requestedMaxByteLength_ and a power of 2.</ins>
1. <ins>NOTE: Implementations may choose to round up the requested maximum byte length, for example, to be on a page boundary.</ins>
1. <ins>Else, append [[ArrayBufferByteLength]] to _slots_.</ins>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(just experimenting with GitHub UI, maybe I need to click the "start a review" button so that the code review UI would appear?)

@syg
syg merged commit a531a18 into master Feb 23, 2021
@syg
syg deleted the allow-maxbytelength-rounding branch February 23, 2021 17:57
Comment thread spec.html
1. <ins>If _requestedMaxByteLength_ is present, then:</ins>
1. <ins>Append [[ArrayBufferByteLengthData]] and [[ArrayBufferMaxByteLength]] to _slots_.</ins>
1. <ins>Let _maxByteLength_ be an implementation-defined value that is &ge; _requestedMaxByteLength_ and a power of 2.</ins>
1. <ins>NOTE: Implementations may choose to round up the requested maximum byte length, for example, to be on a page boundary.</ins>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to highlight this -- could we limit this to a set of granularities rather than giving implementation a blank check here? I think this might have been discussed already but I can't seem to find it now.

syg added a commit that referenced this pull request Apr 8, 2021
syg added a commit that referenced this pull request Apr 19, 2021
* Revert "Wordsmith impl-defined rounding"

This reverts commit 053d008.

* Revert "Allow implementations to round up max byte lengths (#25)"

Close #31

This reverts commit a531a18.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Having to store maxByteLength is not very useful

3 participants