Uh oh!
There was an error while loading. Please reload this page.
region management / remove redundant computation - #524
Conversation
throw if Region ctor fails #220 remove vestigial std::string** update; Region::allregions-> list TravelMapping#523 redundant active/preview mileage TravelMapping#522 redundant active/preview system counts
yakra
commented
Apr 24, 2022
Going to take a closer look at this one. May reopen in a few... hours? Days? |
yakra
commented
Apr 26, 2022
Expected to re-open this after double-checking all my silly benchmarks. Meanwhile, I've hit upon a way to get Region objects into contiguous memory, mutexes and everything. All I've got to do is:
Easy, right? 🤣 This will pay off when I get around to arranging HighwaySystems, Routes & HighwaySegments contiguously. |
yakra
commented
Apr 26, 2022
Found a way to take it a step farther. Be a few hours before I can test on bsdlab (just started BiggaTomato) but the concept looks promising. |
Closesyakra#220. Removes an unused vestigial variable.
Closes#523.
Closes#522.
C++ Region management:
newRegion objects on the heap and store pointers in avector, Regions are emplaced in alist. (I'd prefer avector, but can't becauseRegioncontains astd::mutex, which is immovable, makingRegions immovable too. Went with this instead.)I don't have to manually delete anything, as the list destructor cleans the objects up at the end of the program when the list goes out of scope.
Next up: TravelerLists.
Regionctor to throw if the regions.csv line has the wrong # of fields. AIUI that's considered better practice than setting & checking avalidbit and deleting a fully constructed object, popping it from a container, etc. Cleaner code either way, and a tad less RAM.