1202: doc(runtime-c-api) Improve documentation of the `memory` module r=syrusakbary a=Hywan

Address https://github.com/wasmerio/wasmer/issues/1203.

As part of the daily doc routine, this patch improves the documentation of `memory` module.

This patch also handles more null pointers.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
This commit is contained in:
bors[bot]
2020-02-10 19:55:02 +00:00
committed by GitHub
6 changed files with 437 additions and 70 deletions

View File

@ -7,12 +7,13 @@
int main()
{
wasmer_memory_t *memory = NULL;
wasmer_limits_t descriptor;
descriptor.min = 10;
wasmer_limit_option_t max;
max.has_some = true;
max.some = 15;
descriptor.max = max;
wasmer_limits_t descriptor = {
.min = 10,
.max = {
.has_some = true,
.some = 15,
},
};
wasmer_result_t memory_result = wasmer_memory_new(&memory, descriptor);
printf("Memory result: %d\n", memory_result);
assert(memory_result == WASMER_OK);