Add alt-stack registration support
authorZoltan Varga <vargaz@gmail.com>
Mon, 21 May 2012 23:02:05 +0000 (01:02 +0200)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 24 Jul 2015 18:50:57 +0000 (21:50 +0300)
commit4ceae609d3e20822d7818cdef732348053227e1a
treed47f09efd0a8e88eb33d768cc7fce2aa8b3e26cb
parent61ec29ee41052c7947c7d1c6269aadefcf56d4c9
Add alt-stack registration support
(Apply commit ff4ec56 from 'mono_libgc' branch.)

Fix altstack support in libgc by registering the bounds of the normal
stack and the altstack with it.

* darwin_stop_world.c (GC_stack_range_for): Add paltstack_lo,
paltstack_hi argments; set *paltstack_lo, *paltstack_hi, adjust lo and
hi if p->altstack set.
* darwin_stop_world.c (GC_push_all_stacks): Declare altstack_lo,
altstack_hi local variables; pass &altstack_lo, &altstack_hi to
GC_stack_range_for; do not call GC_push_all_stack(lo, hi) and
adjust total_size by hi-lo if lo is NULL; call
GC_push_all_stack(altstack_lo, altstack_hi) and increment total_size
by altstack_hi-altstack_lo if altstack_lo is non-NULL.
* include/gc.h (GC_register_altstack): New API function declaration.
* include/private/pthread_support.h (GC_Thread_Rep): Add altstack,
altstack_size, stack, stack_size fields.
* pthread_stop_world.c (GC_push_all_stacks): Adjust hi value if
p->altstack set.
* pthread_support.c (main_pthread_self, main_stack, main_altstack,
main_stack_size, main_altstack_size): New static variables.
* pthread_support.c (GC_register_altstack): New function.
* pthread_support.c (GC_thr_init): Set altstack, altstack_size, stack,
stack_size fields from values saved by GC_register_altstack (if called
before GC_thr_init).
* win32_threads.c (GC_register_altstack): New function (unimplemented).
darwin_stop_world.c
include/gc.h
include/private/pthread_support.h
pthread_stop_world.c
pthread_support.c
win32_threads.c