-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
abi/fastly: correct max value length and use scratch buffer in Dictionary#GetBytes #120
Conversation
Nevermind this. I was thinking about the names, not the keys (or values). |
b39e673
to
200090c
Compare
Takes advantage of wasm being single-threaded, and the internal/external boundary to reduce allocations to the minimum necessary to copy bytes from the hostcall to the guest. When the bytes are returned to the caller, they're either copied to a fresh `[]byte` or returned as a `string` (implicit copy).
0a80e65
to
30ccd01
Compare
642eb27
to
bdfaf9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine to merge, and since it doesn't change the public API we're safe to roll-back if we're unhappy with it.
This PR updates work from #117 to handle documented limits for config stores correctly.
In #117 a heuristic was applied to buffers to start small, and increase to a size above the documented limit of "8000 characters." Those characters, however, are UTF-8 encoded, and thus could be comprised of as many as 8000 * 3 bytes. This PR correctly adjusts up to that maximum limit, with an intermediate step for up to 8000 UTF-8 encoded ASCII-range characters, which need 8000 bytes.
It also introduces a scratch space buffer for copies across the host/guest boundary and passes up copies of returned values from the config store.