-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use mmap to allocate procedure stack buffers on E2K
(fix of commit 990dcdb) Issue #411 (bdwgc). This commit prevents stack overflow in case of a big procedure stack to be saved. If a procedure stack requires less than 1 memory page for the buffer, then the buffer is still allocated on the local stack. * include/private/gc_priv.h [E2K] (PS_ALLOCA_BUF, ALLOCA_SAFE_LIMIT, FREE_PROCEDURE_STACK_LOCAL): Define macro. * include/private/gc_priv.h [E2K] (PROCEDURE_STACK_ALLOCA_AND_STORE): Rename to GET_PROCEDURE_STACK_LOCAL; update comment; modify implementation to call GC_mmap_procedure_stack_buf (and GC_unmap_procedure_stack_buf) if size > ALLOCA_SAFE_LIMIT. * include/private/gc_priv.h [E2K] (GC_mmap_procedure_stack_buf, GC_unmap_procedure_stack_buf): Declare function. * include/private/gc_priv.h [E2K && THREADS] (GC_alloc_and_get_procedure_stack): Refine comment. * mach_dep.c [E2K]: Include sys/mman.h. * mach_dep.c [E2K] (GC_mmap_procedure_stack_buf, GC_unmap_procedure_stack_buf): Implement. * mark_rts.c [E2K && !THREADS] (GC_push_current_stack): Rename PROCEDURE_STACK_ALLOCA_AND_STORE to GET_PROCEDURE_STACK_LOCAL; call FREE_PROCEDURE_STACK_LOCAL() when bs_lo is not needed. * pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL && E2K] (GC_suspend_handler_inner, GC_push_all_stacks): Likewise.
- Loading branch information
Showing
4 changed files
with
83 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters