Skip to content

Replace private uses of DataStructures::List/Queue/OrderedList/Map/Hash with the standard library (std migration, stage 2) #60

Open

Description

@Segfaultd

Follow-up to #50 / #58, second of three stages. Depends on #59.

Scope

The general-purpose containers are used 768 times across the library; DataStructures::List alone accounts for 402. This stage converts every use that is not part of a public signature: member variables, locals and private helpers in the 36 Source/src/*.cpp files and in the private sections of headers. Public method and virtual signatures are left exactly as they are (that is stage 3).

Container References Replacement
List 402 std::vector
Queue 56 std::deque (or std::queue)
OrderedList 55 sorted std::vector with std::lower_bound, or std::set/std::map where lookups dominate
Hash / HashIndex 11 / 31 std::unordered_map
Map 14 std::map or std::unordered_map

Approach

  • Mechanical but large; do it per subsystem (reliability layer, peer, each plugin) in separate commits so bisecting stays possible.
  • Where a value crosses a public boundary (a private std::vector that must be handed out through a still-public DataStructures::List&), add a small conversion at the boundary rather than changing the signature; stage 3 removes those conversions.
  • Watch for RemoveAtIndexFast (swap-remove, order not preserved) and ring-buffer Queue capacity assumptions; both change iteration order or memory behaviour when swapped for standard types.
  • Allocations through these containers currently go via rakMalloc/OP_NEW with file-and-line tracking. Decide once whether the standard containers get a std::allocator shim onto rakMalloc or whether that tracking is dropped for them; apply uniformly.

Acceptance

  • No DataStructures::List|Queue|OrderedList|Map|Hash use remains in Source/src/ or in private/protected sections of headers.
  • Public declarations unchanged.
  • Full suite green on Linux (Debug, Release), macOS, Windows; samples build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions