Function libyml::api::yaml_malloc
source · pub unsafe fn yaml_malloc(size: u64) -> *mut c_void
Expand description
Allocate memory using the system’s malloc
function.
This function is a thin wrapper around the system’s malloc
function,
used for memory allocation within the LibYML crate.
§Safety
- This function is unsafe because it directly calls the system’s
malloc
function, which can lead to undefined behaviour if misused. - The caller must ensure that the requested size is valid and does not overflow.
- The caller is responsible for properly freeing the allocated memory using
the corresponding
yaml_free
function when it is no longer needed.