Merge pull request #836 from pcercuei/update-lightrec-20240611
[pcsx_rearmed.git] / deps / lightrec / blockcache.c
index bb58cdb..ecfe80e 100644 (file)
@@ -101,7 +101,7 @@ void lightrec_unregister_block(struct blockcache *cache, struct block *block)
                }
        }
 
-       pr_err("Block at PC 0x%x is not in cache\n", block->pc);
+       pr_err("Block at "PC_FMT" is not in cache\n", block->pc);
 }
 
 static bool lightrec_block_is_old(const struct lightrec_state *state,
@@ -142,7 +142,7 @@ static void lightrec_free_blocks(struct blockcache *cache,
                                if (ENABLE_THREADED_COMPILER)
                                        lightrec_recompiler_remove(state->rec, block);
 
-                               pr_debug("Freeing outdated block at PC 0x%08x\n", block->pc);
+                               pr_debug("Freeing outdated block at "PC_FMT"\n", block->pc);
                                remove_from_code_lut(cache, block);
                                lightrec_unregister_block(cache, block);
                                lightrec_free_block(state, block);
@@ -159,9 +159,14 @@ void lightrec_remove_outdated_blocks(struct blockcache *cache,
        lightrec_free_blocks(cache, except, false);
 }
 
-void lightrec_free_block_cache(struct blockcache *cache)
+void lightrec_free_all_blocks(struct blockcache *cache)
 {
        lightrec_free_blocks(cache, NULL, true);
+}
+
+void lightrec_free_block_cache(struct blockcache *cache)
+{
+       lightrec_free_all_blocks(cache);
        lightrec_free(cache->state, MEM_FOR_LIGHTREC, sizeof(*cache), cache);
 }