From 89da530898fa08c23b59e3e3bf64f266f113e014 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 23 Jan 2024 10:01:11 +0100 Subject: [DYNAREC] use an rbtree for dynablock size and max_db_size update --- src/box64context.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/box64context.c') diff --git a/src/box64context.c b/src/box64context.c index b302b777..679ee108 100644 --- a/src/box64context.c +++ b/src/box64context.c @@ -21,6 +21,7 @@ #include "signals.h" #include "rcfile.h" #include "gltools.h" +#include "rbtree.h" EXPORTDYN void initAllHelpers(box64context_t* context) @@ -264,6 +265,10 @@ box64context_t *NewBox64Context(int argc) context->globdata = NewMapSymbols(); initAllHelpers(context); + + #ifdef DYNAREC + context->db_sizes = init_rbtree(); + #endif return context; } @@ -359,6 +364,11 @@ void FreeBox64Context(box64context_t** context) FreeMapSymbols(&ctx->globdata); +#ifdef DYNAREC + //dynarec_log(LOG_INFO, "BOX64 Dynarec at exit: Max DB=%d, righter=%d\n", ctx->max_db_size, rb_get_righter(ctx->db_sizes)); + delete_rbtree(ctx->db_sizes); +#endif + finiAllHelpers(ctx); #ifdef DYNAREC -- cgit 1.4.1