MCPcopy Create free account
hub / github.com/BanjoRecomp/BanjoRecomp / recomputil_destroy_memory_slotmap

Function recomputil_destroy_memory_slotmap

src/game/recomp_data_api.cpp:576–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574}
575
576void recomputil_destroy_memory_slotmap(uint8_t* rdram, recomp_context* ctx) {
577 uint32_t mapkey = _arg<0, uint32_t>(rdram, ctx);
578
579 // Retrieve the map.
580 MemorySlotmap* map;
581 if (!memory_slotmaps.get(mapkey, &map)) {
582 HANDLE_INVALID_ERROR();
583 }
584
585 // Free all of the entries in the map.
586 PTR(void) cur_mem;
587 while (map->first.erase_first(cur_mem)) {
588 recomp::free(rdram, TO_PTR(void, cur_mem));
589 }
590
591 // Destroy the map itself.
592 memory_slotmaps.erase(mapkey);
593}
594
595void recomputil_memory_slotmap_contains(uint8_t* rdram, recomp_context* ctx) {
596 uint32_t mapkey = _arg<0, uint32_t>(rdram, ctx);

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
erase_firstMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected