~/talk

C++ and the Fight Between Elves and Orcs

Talkat CppNorth 2023 · 2023-07-17..07-19· [c-and-cpp]
links:none on file
slides:none on file

Live-coding of a custom allocation strategy: a type-local member operator new/delete and an arena-based allocator that preallocates size_of(Orc)×N (example N = 10,000 or suggested 10 million) into a contiguous buffer; Orcs are 24 bytes each. Measured baseline using vendor new ≈ 492,000 μs to allocate N objects and ≈ 220 μs to destroy them; the arena version returns allocations in constant time and nearly zero work on delete, yielding orders-of-magnitude speedup and deterministic constant-time behavior. Caveats: no array forms, overflow checks, and derived-class size/slicing pitfalls.

AI-written summary · about

  1. 0:00Introduction
  2. 1:45New and Delete
  3. 18:39Vector
  4. 19:54Standard Function
  5. 22:09The Fight
  6. 25:14Arena Based Allocation
  7. 26:25Arena Template
  8. 28:39Memory Allocation
  9. 34:39Using Knowledge
  10. 37:39Summary
  11. 44:04Things to be careful of
  12. 46:00Inheritance issues
  13. 47:43What happens when new fails
  14. 49:31Placement Unit
~/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.