Function libyml::internal::yaml_stack_extend
source · pub unsafe fn yaml_stack_extend(
start: *mut *mut c_void,
top: *mut *mut c_void,
end: *mut *mut c_void,
)
Expand description
Extend a stack by reallocating and copying the existing data.
This function is used to grow a stack when more space is needed.
§Safety
- This function is unsafe because it directly calls the system’s
realloc
function, which can lead to undefined behaviour if misused. - The caller must ensure that
start
,top
, 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.