diff options
| author | namorniradnug <[email protected]> | 2025-08-20 16:26:10 +0300 |
|---|---|---|
| committer | namorniradnug <[email protected]> | 2025-08-20 16:54:12 +0300 |
| commit | cdf098cf11a6b3c1451f83135394b7f82438df67 (patch) | |
| tree | fa9bd676a6b7fae4906349bb7ce37e3bf2e6f338 /library/cpp/cache/thread_safe_cache.cpp | |
| parent | bb6c48f24c7a2004cb90d7f2907d49a29888b25e (diff) | |
Use default copy for `TYsonItem` instead of `memcpy`
Current implementation has the following problems:
- Since `memcpy` requires `src` and `dest` to be non-overlaping, the behaviour of self-assigning is undefined
- It produces less optimal code because it implicitly invokes the default ctor of `TYsonItem`, which is non-trivial. The default ctor fills `Data_` with zeros and the compiler doesn't optimize it out (<https://godbolt.org/z/59ozv7e3f>)
- Newer versions of clang produce a `nontrivial-memcall` warning
commit_hash:9fa2681ce24852c0f333e79e55ef07d4a941fb77
Diffstat (limited to 'library/cpp/cache/thread_safe_cache.cpp')
0 files changed, 0 insertions, 0 deletions
