rockwotj opened PR #7115 from rockwotj:mem
to bytecodealliance:main
.
rockwotj requested fitzgen for a review on PR #7115.
rockwotj requested wasmtime-core-reviewers for a review on PR #7115.
rockwotj edited PR #7115.
rockwotj updated PR #7115.
fitzgen submitted PR review:
Thanks! Just a couple nitpicks below.
fitzgen created PR review comment:
The return type in the C header is
void*
but here we have*mut u8
. For consistency, either
- this should change to
*mut std::ffi::c_void
- or the C header should change to
uint8_t*
fitzgen submitted PR review:
Thanks! Just a couple nitpicks below.
fitzgen created PR review comment:
Can you document in the C header's docs for the
wasmtime_memory_creator_t
that the functions need to be thread safe? Thanks.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
One suggestion I'd have for this is to have a
void*
that's passed intonew_memory
as well, but then that would make it a bit confusing since a differentvoid*
is passed to new vs get/grow. In that case I might additionally recommend one of two changes:
- Split this structure into "creator callbacks" with new + finalizer and "memory callbacks" with get + grow + finalizer
- Move the
new_memory
callback to thewasmtime_config_host_memory_creator_set
function as an argument.I'm somewhat partial to (1) here, but could go either way (I don't design that many C APIs)
rockwotj submitted PR review.
rockwotj created PR review comment:
I changed the C header. Nice catch!
rockwotj updated PR #7115.
rockwotj submitted PR review.
rockwotj created PR review comment:
I prefer 1 as well. It is done.
rockwotj submitted PR review.
rockwotj created PR review comment:
Thanks! Done.
rockwotj requested fitzgen for a review on PR #7115.
rockwotj requested alexcrichton for a review on PR #7115.
rockwotj updated PR #7115.
rockwotj updated PR #7115.
rockwotj updated PR #7115.
alexcrichton submitted PR review:
Thanks for this!
rockwotj updated PR #7115.
rockwotj updated PR #7115.
alexcrichton merged PR #7115.
Last updated: Dec 23 2024 at 12:05 UTC