mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-27 03:12:13 +00:00
doc(runtime-c-api) Improve documentation of wasmer_memory_length
.
This commit is contained in:
parent
ed77c9c64f
commit
78056df6cc
@ -120,7 +120,17 @@ pub extern "C" fn wasmer_memory_grow(memory: *mut wasmer_memory_t, delta: u32) -
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the current length in pages of the given memory
|
/// Reads the current length (in pages) of the given memory.
|
||||||
|
///
|
||||||
|
/// The function returns zero if `memory` is null.
|
||||||
|
///
|
||||||
|
/// Example:
|
||||||
|
///
|
||||||
|
/// ```c
|
||||||
|
/// uint32_t memory_length = wasmer_memory_length(memory);
|
||||||
|
///
|
||||||
|
/// printf("Memory pages length: %d\n", memory_length);
|
||||||
|
/// ```
|
||||||
#[allow(clippy::cast_ptr_alignment)]
|
#[allow(clippy::cast_ptr_alignment)]
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn wasmer_memory_length(memory: *const wasmer_memory_t) -> u32 {
|
pub extern "C" fn wasmer_memory_length(memory: *const wasmer_memory_t) -> u32 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user