Function libyml::api::yaml_string_extend
source · pub unsafe fn yaml_string_extend(
start: *mut *mut u8,
pointer: *mut *mut u8,
end: *mut *mut u8,
)
Expand description
Extend a string buffer by reallocating and copying the existing data.
This function is used to grow a string buffer when more space is needed.
§Safety
- This function is unsafe because it directly calls the system’s
realloc
andmemset
functions, which can lead to undefined behaviour if misused. - The caller must ensure that
start
,pointer
, andend
are valid pointers into the same allocated memory block. - The caller must ensure that the memory block being extended is large enough to accommodate the new size.
- The caller is responsible for properly freeing the extended memory block using
the corresponding
yaml_free
function when it is no longer needed.