diff --git a/core/dynamo.c b/core/dynamo.c index c08c7f1bf11..ae1e608e0f1 100644 --- a/core/dynamo.c +++ b/core/dynamo.c @@ -1547,6 +1547,8 @@ dynamo_exit_post_detach(void) #ifdef UNIX post_execve = false; #endif + vm_areas_post_exit(); + heap_post_exit(); } dcontext_t * diff --git a/core/heap.c b/core/heap.c index ca71b5fa846..0e24de41c21 100644 --- a/core/heap.c +++ b/core/heap.c @@ -1706,6 +1706,12 @@ heap_exit() heapmgt = &temp_heapmgt; } +void +heap_post_exit() +{ + heap_exiting = false; +} + /* FIXME: * detect if the app is who we're fighting for memory, if so, don't * free memory, else the app will just keep grabbing more. diff --git a/core/heap.h b/core/heap.h index 7f24e0e9157..b632c997823 100644 --- a/core/heap.h +++ b/core/heap.h @@ -125,6 +125,7 @@ bool rel32_reachable_from_vmcode(byte *target); /* heap management */ void heap_init(void); void heap_exit(void); +void heap_post_exit(void); /* post exit to support reattach */ void heap_reset_init(void); void heap_reset_free(void); void heap_thread_init(dcontext_t *dcontext); diff --git a/core/vmareas.c b/core/vmareas.c index 05936913e10..521dfaa5335 100644 --- a/core/vmareas.c +++ b/core/vmareas.c @@ -1801,6 +1801,12 @@ vm_areas_exit() return 0; } +void +vm_areas_post_exit() +{ + vm_areas_exited = false; +} + void vm_areas_thread_reset_init(dcontext_t *dcontext) { diff --git a/core/vmareas.h b/core/vmareas.h index 74500e1f207..d7bb7abbb97 100644 --- a/core/vmareas.h +++ b/core/vmareas.h @@ -247,6 +247,10 @@ vm_areas_init(void); int vm_areas_exit(void); +/* post cleanup to support reattach */ +void +vm_areas_post_exit(void); + /* thread-shared initialization that should be repeated after a reset */ void vm_areas_reset_init(void);