Urgent.News

What's breaking now, across thousands of outlets.

Tech

C++26: std::hive

The report discusses the introduction of std::hive in C++26, a new container that offers a unique combination of stability, efficiency, and cache locality. Unlike traditional containers like std::vector and std::list, std::hive uses multiple memory blocks instead of a single contiguous allocation. This design choice allows for O(1) amortized insertion and erasure operations while maintaining stable pointers and iterators.

The key features of std::hive include multiple memory blocks, a skipfield for efficient iteration past erased elements, and slot reuse for subsequent insertions. These design decisions make std::hive particularly suitable for applications like game engines, where multiple subsystems need to hold cross-references to entities without invalidating pointers and iterators.

The skipfield, which encodes the run length of consecutive erased slots, enables efficient iteration without the performance issues associated with boolean "is-alive" flags.

Brief written by urgent.news from Lobsters's own syndicated text. Machine-written — may contain errors; check the original before relying on it.

Read the original at sandordargo.com →

More in Tech

ShrekOS Can Update Itself Now. I Know Because I Broke It First.

I have been calling ShrekOS an immutable operating system for a while now. That sounds nice. It also does not mean very much if the machine cannot safely replace itself.

  • ShrekOS now capable of self-updating
  • Reporter intentionally broke system to test update
  • Update process involves writing new system to separate slot

More from Saturday 5 September →