LukasForst opened PR #5761 from main
to main
:
This was not yet discussed, but as of now, there's no way how to use StoreLimits from the C API. This PR adds
wasmtime_store_limiter
that allows setting supported limits for the Store.Not sure who to assign for this PR, judging from the past PRs for c-api @alexcrichton maybe?
alexcrichton submitted PR review.
alexcrichton created PR review comment:
I think there's a case to be made for allowing precisely 0 of the above items, so could this instead perhaps use a negative value to indicate "use the default"?
LukasForst submitted PR review.
LukasForst created PR review comment:
I was thinking about this as well, but in that case we would need to use different types then
usize
andu32
. What do you suggest using instead of these?
alexcrichton submitted PR review.
alexcrichton created PR review comment:
For some of these values the range of
0..i32::MAX
is sufficient (or evenisize::MAX
). Otherwise though you could also add a dedicatedstruct
with getters/setters where not calling a setter is equivalent to "none" or something like that. I don't know the best way to handle optional parameters in C myself.
LukasForst created PR review comment:
struct
is not perfect, you'd end up with same problems, even if you use pointers on integers.. because then (afaik) you wouldn't be able to distinguish0
andNULL
.Let's go with
-1
as indication "to leave default" andi64
for all types. That way we keep the ranges "sort of same" and we will have a way to use0
as a correct value.
LukasForst submitted PR review.
LukasForst updated PR #5761 from main
to main
.
LukasForst requested alexcrichton for a review on PR #5761.
LukasForst edited PR review comment.
LukasForst edited PR review comment.
LukasForst updated PR #5761 from main
to main
.
alexcrichton submitted PR review.
alexcrichton has enabled auto merge for PR #5761.
alexcrichton has disabled auto merge for PR #5761.
alexcrichton closed without merge PR #5761.
alexcrichton reopened PR #5761 from main
to main
.
alexcrichton has enabled auto merge for PR #5761.
alexcrichton merged PR #5761.
Last updated: Nov 22 2024 at 16:03 UTC