~/lightning

My favourite memory leak

Lightningat Meeting C++ 2023 · 2023-11-12..11-14· [career-development]
slides:none on file

Claim: a leak happens without calling new by exploiting a recursively nested std::vector: a type V holds vector<V> children, creating one child and then swapping the parent with that child. Swap merely exchanges buffer pointers (swap pointers), producing a self‑owning structure that leaves an orphaned element whose heap buffer is unreachable when a scope ends. The concrete build uses std::vector internals and a single emplace_back so the surprising count is one leaked buffer.

AI-written summary · about

~/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.