MT#55283 allow for copy from self

Change-Id: I521d6adb5845f0fabb263193a28f4d3233552741
pull/2173/head
Richard Fuchs 1 week ago
parent 23bb5401a8
commit ad2dca04c4

@ -118,6 +118,10 @@ INLINE str memory_arena_str_cpy_lw(const str *in) {
return memory_arena_str_cpy_fn_lw((in ? in->s : NULL), (in ? in->len : 0));
}
INLINE void memory_arena_str_cpy_free(str *out, const str *in) {
if (in && out->s == in->s) {
out->len = in->len;
return;
}
memory_arena_free_lw(out->s);
*out = memory_arena_str_cpy_fn_lw((in ? in->s : NULL), (in ? in->len : 0));
}

Loading…
Cancel
Save