Function CSTL_string_copy_assign

Source
pub unsafe extern "C" fn CSTL_string_copy_assign(
    instance: CSTL_StringRef,
    alloc: *mut CSTL_Alloc,
    other_instance: CSTL_StringCRef,
    other_alloc: *mut CSTL_Alloc,
    propagate_alloc: bool,
)
Expand description

Replaces the contents of instance with the contents of other_instance.

If propagate_alloc == true && alloc != other_alloc then storage is freed with alloc and allocated again with other_alloc before contents are copied. Then, instance uses other_alloc as its allocator.

If propagate_alloc == false instance keeps using alloc as its allocator, potentially reusing its storage.

You are responsible for replacing the allocator outside of CSTL_StringVal if applicable.