Function libyml::api::yaml_free

source ·
pub unsafe fn yaml_free(ptr: *mut c_void)
Expand description

Free memory allocated by yaml_malloc or yaml_realloc.

This function is a thin wrapper around the system’s free function, used for freeing memory within the LibYML crate.

§Safety

  • This function is unsafe because it directly calls the system’s free function, which can lead to undefined behaviour if misused.
  • The caller must ensure that the provided ptr is either a valid pointer returned by a previous call to yaml_malloc or yaml_realloc, or a null pointer.
  • If ptr is a null pointer, no operation is performed.