From 8c2f91a8065d9fb7b238d5c3709bc95dcc727566 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 17 Jan 2022 23:51:47 +0300 Subject: Free E2K procedure stack in a single function (refactoring) Issue #413 (bdwgc). * include/private/gc_priv.h [E2K] (GC_get_procedure_stack): Document that the function mgiht be called from a signal handler. * include/private/gc_priv.h [E2K] (GC_free_procedure_stack): New function prototype. * mach_dep.c [E2K] (GC_free_procedure_stack): Implement (just call free() for now). * mark_rts.c [!THREADS && !IA64 && E2K] (GC_push_current_stack): Call GC_free_procedure_stack() instead of free(). * pthread_stop_world.c [E2K] (GC_suspend_handler_inner): Likewise. * pthread_stop_world.c [E2K] (GC_push_all_stacks): Likewise. * pthread_support.c [E2K] (GC_do_blocking_inner, GC_call_with_gc_active): Likewise. * pthread_stop_world.c [E2K] (GC_push_all_stacks): Move stack_size local variable declaration to the innermost scope of its usage. --- mach_dep.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mach_dep.c') diff --git a/mach_dep.c b/mach_dep.c index 6a4db79a..c90f8e02 100644 --- a/mach_dep.c +++ b/mach_dep.c @@ -66,6 +66,10 @@ >> (63-E2K_PSHTP_SIZE)); \ } while (0) + GC_INNER void GC_free_procedure_stack(ptr_t buf) { + free(buf); + } + GC_INNER size_t GC_get_procedure_stack(ptr_t *buf_ptr) { word ps; ptr_t buf = NULL; -- cgit v1.2.1