Use std::unordered_map and std::vector for sections

This allows us to control the order in which sections are iterated,
instead of it depending on the internals of `std::map`. (This order
is arbitrary, but should be deterministic regardless.)
This commit is contained in:
Rangi42
2024-03-16 11:51:47 -04:00
parent cefc4f4aa3
commit d06376c170
3 changed files with 12 additions and 9 deletions

View File

@@ -13,7 +13,7 @@ SECTION "test", ROM0
charmap "<FAR>", $08
; At this point, enough nodes were allocated for 'foo' to be reallocated.
; Its value in the charmaps' std::map should have been updated too,
; Its value in the charmaps' `std::unordered_map` should have been updated too,
; so that usages of 'foo' will not segfault.
; This uses 'foo; by switching to it.

View File

@@ -2,7 +2,7 @@ SECTION "Collision course", OAM[$FE00]
; All the following symbols used to collide with our custom hashmap,
; which at some point caused `PURGE` to malfunction with them.
; We now use C++ `std::map` which reliably handles collisions.
; We now use C++ `std::unordered_map` which reliably handles collisions.
aqfj: ds 1 ; Give them different addresses
cxje: ds 1
dgsd: ds 1