mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-16 16:20:49 +00:00
doc(runtime-c-api) Improve documentation of wasmer_memory_data
.
This commit is contained in:
parent
7eeffb8d63
commit
da439fc05f
@ -169,6 +169,11 @@ pub extern "C" fn wasmer_memory_length(memory: *const wasmer_memory_t) -> u32 {
|
||||
///
|
||||
/// ```c
|
||||
/// uint8_t *memory_data = wasmer_memory_data(memory);
|
||||
/// char *str = (char*) malloc(sizeof(char) * 7);
|
||||
///
|
||||
/// for (uint32_t nth = 0; nth < 7; ++nth) {
|
||||
/// str[nth] = (char) memory_data[nth];
|
||||
/// }
|
||||
/// ```
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
#[no_mangle]
|
||||
|
Loading…
x
Reference in New Issue
Block a user