unique_ptr with an empty lambda deleter stays 8 bytes; a function-pointer deleter doubles it to 16

A unique_ptr With a Custom Deleter That Costs Zero Bytes

Wrapping a C handle in unique_ptr with a function-pointer deleter doubles the pointer to 16 bytes. Putting the function into the deleter type instead, with an alias template over decltype of a static lambda, brings it back to 8. Sizes checked on GCC 14.2, GCC 16.2, Clang 22.1 and MSVC 19.44, with live Godbolt sessions.

October 20, 2026 · 4 min · Pavel Guzenfeld
Running AddressSanitizer on a dlopened GStreamer plugin with LD_PRELOAD of libasan

ASan on a GStreamer Plugin When the Host Binary Has No ASan

You built your GStreamer plugin with -fsanitize=address and gst-launch-1.0 says the element doesn’t exist. The runtime has to be in the process before anything else. One LD_PRELOAD fixes it, and one repeated -D flag quietly turns ASan off in colcon builds.

October 20, 2026 · 6 min · Pavel Guzenfeld
Building a {}{}{} format string at compile time with a loop, ranges, and an index_sequence fold

Building a "{}{}{}" Format String at Compile Time, Three Ways

A variadic concat(args…) that builds its own “{}{}{}” pattern at compile time, written three ways: a plain loop, a ranges pipeline, and an index_sequence with a comma fold. fmt 12 and std::format both still check the generated pattern at compile time, but only if it is static constexpr. Verified on GCC 14.2, GCC 16.2, Clang 22.1 and MSVC 19.44.

October 20, 2026 · 5 min · Pavel Guzenfeld
The Road to Boost.SML 1.2.0

The Road to Boost.SML 1.2.0: New API and a Type-Name Heisenbug

A warts-and-all account of cutting the Boost.SML 1.2.0 release — four new public APIs, a behavior change rooted in undefined behavior, a type-name Heisenbug that only fired on GCC and MSVC, a dead “Run” button, and the surprisingly deep rabbit hole of making 30 Compiler Explorer links that actually work.

June 1, 2026 · 14 min · Pavel Guzenfeld
C++ tools that enforce low-latency patterns — builtins, compiler flags, clang-tidy checks

C++ Low-Latency, Enforced: __builtin_*, Compiler Flags, and clang-tidy, Benchmarked

Follow-up to the 15-pattern HFT post. The first post asked ‘which patterns work?’ This post answers ‘how do you force your team to keep using them?’ Seven new nanobench programs, each with a working Godbolt link, covering __builtin_popcountll (24x faster than a bit-count loop), __builtin_unreachable in switch defaults (1.55x), __builtin_bswap64 (same speed as the portable idiom — GCC already folds it), [[likely]] and [[unlikely]] (no measurable effect on tight loops — an honest null result), and a flags matrix showing -ffast-math + -march=x86-64-v3 giving 6.9x over -O2. Then a .clang-tidy config that fails CI on every common perf regression, with the performance-for-range-copy warning demonstrated at 41x real runtime cost.

April 23, 2026 · 21 min · Pavel Guzenfeld
Fixing a CI Pipeline on Jetson Xavier

Fixing a CI Pipeline on a Jetson Xavier — 15 Failures to Green

A day-long battle fixing a CI pipeline that builds Docker images on a self-hosted Jetson Xavier runner. From stale git submodules to GCC-15 assembler errors, expired tokens, DNS failures inside Docker, and deleted upstream branches — every layer of the stack had something broken.

March 20, 2026 · 10 min · Pavel Guzenfeld
How GCC's fill_n Regressed Eigen's AutoDiffScalar

How GCC's std::fill_n Silently Regressed Eigen's AutoDiffScalar Performance

A performance optimization in Eigen’s fill path assumed all scalar types are equal. GCC’s libstdc++ disagreed — and AutoDiffScalar paid the price.

March 20, 2026 · 4 min · Pavel Guzenfeld
Fixing GCC False-Positive Warnings in Eigen

Fixing GCC False-Positive Warnings in Eigen: A Deep Dive into -Warray-bounds at -O3

How a GCC 13 false-positive -Warray-bounds warning in Eigen’s TensorContraction led to a lesson about if constexpr, C++14 portability, and the right way to suppress compiler warnings in a large codebase.

March 18, 2026 · 4 min · Pavel Guzenfeld