~/talk

Trivially Relocatable

Talkat CppCon 2018 · 2018-09-23..09-28· [rust]
slides:none on file

Argument: certain types can be treated as bitwise-movable so relocation becomes a single memcpy instead of move-then-destroy loops. Demonstration: compiler experiments on Godbolt/Compiler Explorer with Clang experimental P1144 and a custom attribute plus the trait std::is_trivially_relocatable, and microbenchmarks with Google Benchmark. Result: reallocating vectors of pointer-like types (unique_ptr/shared_ptr) becomes 3x faster in reserve-heavy scenarios by relying on memcpy relocation rather than element-wise moves.

AI-written summary · about

  1. 0:00Intro
  2. 0:13Motivating "relocation"
  3. 1:44Relocating trivially copyable types
  4. 2:53Relocating non-trivial types
  5. 4:54Benchmark results
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.