From 3b9feeed120af45a2dc346592b328eb0b2e14911 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 11 Apr 2021 11:05:36 +0200 Subject: Improvement in internal mutex handling on signal, and [DYNAREC] multitasking changes to the JmpTable --- src/custommem.c | 82 +++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 65 insertions(+), 17 deletions(-) (limited to 'src/custommem.c') diff --git a/src/custommem.c b/src/custommem.c index 634b849b..f4c0102d 100644 --- a/src/custommem.c +++ b/src/custommem.c @@ -21,6 +21,7 @@ #include #include "custommem.h" #include "khash.h" +#include "threads.h" #ifdef DYNAREC #include "dynablock.h" #include "dynarec/arm64_lock.h" @@ -55,7 +56,7 @@ typedef struct blocklist_s { #define MMAPSIZE (256*1024) // allocate 256kb sized blocks -static pthread_mutex_t mutex_blocks = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t mutex_blocks; static int n_blocks = 0; // number of blocks for custom malloc static blocklist_t* p_blocks = NULL; // actual blocks for custom malloc @@ -570,23 +571,25 @@ void addJumpTableIfDefault64(void* addr, void* jmp) uintptr_t*** tbl = (uintptr_t***)malloc((1<