pinned_vector
summary
pinned_vector claims a contiguous container that avoids pointer invalidation by reserving huge virtual address ranges and committing pages on demand with VirtualAlloc / mmap, so push_back never triggers a relocate and pop_back can decommit pages. Benchmarks show comparable performance when reserved and up to 5× speedup for large, nontrivial element counts because copies and reallocations vanish. Works on Linux, macOS and Windows (limited on some mobile platforms), source due on GitHub.
AI-written summary · about
chapters (20)
- 0:00Start
- 1:59std::vector Invalidation
- 4:02Contiguous Storage Invariant
- 5:11Alternatives with Truly Stable Pointers
- 9:35pinned_vector Invalidation
- 10:09Virtual Memory History
- 11:18Virtual Memory vs Physical Memory
- 14:12Memory Management Unit
- 15:07Translation Lookaside Buffer
- 17:00Swap Space
- 18:37TLB Miss
- 19:26Thrashing
- 20:04Mapping Memory
- 21:02pinned_vector Internals
- 33:08Availability
- 34:25Use Case ECS
- 37:42ECS with std:: array
- 39:01Future Work
- 39:44Thank you
- 42:10Benchmark Conclusions
related talks
01h 02mBack to Basics: Almost Always Vector
26mpin-init: Solving Address Stability in Rust
56mC++ Relocation - How to Achieve Blazing Fast Save and Restore and More!
05mVector to Array
08mTrivially Relocatable
25mThe Mystery of the Pin
01h 02mA Lock-Free Atomic Shared Pointer in Modern Cpp
59mFunctional Programming: data
