Show HN: SSO – Small String Optimization I wrote this just for fun when saw article about sso in Rust[1]. My string can store up to 23 (excluding null-terminator) 8-bit chars without calling allocator. Here I can mistake, but.. Curious fact: both - libstdc++[2] and libc++[3] - do access to union member without any check that it is active now. AFAIK, this is UB in C++. But I assume that they just rely on theirs compiler features. I tried to avoid this using `std::byte[]`. But I'm still sure that there are several UB's in my code :) [1] https://ift.tt/0iPeAb3... [2] https://ift.tt/nYcDsBK... [3] https://ift.tt/C0QEkYj... https://ift.tt/9iDytOh October 12, 2024 at 11:56PM
Show HN: SSO – Small String Optimization https://ift.tt/dpOXnL1
Related Articles
Show HN: Automated Site/IP Scanner https://ift.tt/2XHjONMShow HN: Automated Site/IP Scanner https://ift.tt/2XQrAUq June 9, 2020… Read More
Show HN: Workout Daily. We text new 7-minute workouts daily to make fitness easy https://ift.tt/2MZlwnGShow HN: Workout Daily. We text new 7-minute workouts daily to make fi… Read More
Show HN: Spleeter Web – Isolate the musical parts of any song https://ift.tt/30Hc7ZRShow HN: Spleeter Web – Isolate the musical parts of any song https://… Read More
Show HN: Product Checklist – A collection of best practices for building product https://ift.tt/3e4CDjDShow HN: Product Checklist – A collection of best practices for buildi… Read More
Show HN: I'm developing a 3D engine in JavaScript and WebGL and video logging it https://ift.tt/37tZ1AxShow HN: I'm developing a 3D engine in JavaScript and WebGL and video … Read More
Show HN: I built a living memorial to George Floyd and others https://ift.tt/2MEp7HfShow HN: I built a living memorial to George Floyd and others https://… Read More
Show HN: Poica – Algebraic data types and type introspection for pure C https://ift.tt/3efQHacShow HN: Poica – Algebraic data types and type introspection for pure … Read More
Show HN: Probabilistic Data Structure Template Library (C++14) https://ift.tt/3huhSAeShow HN: Probabilistic Data Structure Template Library (C++14) https:/… Read More
0 Comments: