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_limiterthat 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
usizeandu32. 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::MAXis sufficient (or evenisize::MAX). Otherwise though you could also add a dedicatedstructwith 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:
structis 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 distinguish0andNULL.Let's go with
-1as indication "to leave default" andi64for all types. That way we keep the ranges "sort of same" and we will have a way to use0as 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: Dec 13 2025 at 19:03 UTC