Skip to content

Commit

Permalink
Merge branch 'gc-7_2-hotfix-3' into release-7_2
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmai committed Aug 9, 2012
2 parents 6b480c6 + 9b5fd95 commit ebf3955
Show file tree
Hide file tree
Showing 18 changed files with 415 additions and 239 deletions.
75 changes: 75 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,78 @@
2012-08-05 Ivan Maidanski <ivmai@mail.ru>

* config.guess: Regenerate (by autoreconf -vif using autoconf-2.68,
automake-1.11.1 and libtool-2.4).
* config.sub: Likewise.
* m4/libtool.m4: Likewise.

2012-08-02 Ivan Maidanski <ivmai@mail.ru>

* misc.c (GC_clear_stack_inner): Use GC_approx_sp() instead of
"dummy[0]" set to "&dummy" value (that worked as expected only for
STACK_GROWS_DOWN case).

2012-08-02 Ivan Maidanski <ivmai@mail.ru>

* alloc.c (min_bytes_allocd, GC_stopped_mark): Use GC_approx_sp()
instead of "&dummy"; remove 'dummy' local variable.
* dyn_load.c (GC_cond_add_roots): Likewise.
* misc.c (GC_init): Likewise.
* os_dep.c (GC_get_stack_base, GC_get_main_stack_base): Likewise.
* pthread_stop_world.c (GC_suspend_handler_inner,
nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Likewise.
* pthread_support.c (GC_thr_init): Likewise.
* ptr_chck.c (GC_on_stack): Likewise.
* win32_threads.c (GC_push_stack_for): Likewise.
* extra/setjmp_t.c (main): Define volatile 'sp' local variable, store
its address to it and use it instead of "&dummy"; remove 'dummy' local
variable.
* mach_dep.c (GC_with_callee_saves_pushed): Use volatile for 'dummy'
local variable.
* misc.c (GC_clear_stack_inner): Store address of volatile 'dummy'
local array (i.e. 'sp' value) to its first element (and use it in the
comparison of addresses) to prevent any harmful optimizations as C
officially disallows comparisons of pointers to different objects
(e.g., some Mac OS X clang releases might turn a conditional
expression that uses 'dummy' address into a constant); update comment.
* misc.c (GC_call_with_stack_base): Use "&base" instead of "&dummy"
(it is safe to use address of base here); remove dummy variable.

2012-08-01 Ivan Maidanski <ivmai@mail.ru>

* misc.c (GC_call_with_stack_base): Call GC_noop1 after fn()
invocation to prevent a tail-call optimization.

2012-07-21 Ivan Maidanski <ivmai@mail.ru>

* os_dep.c (GC_get_stack_base): Abort if pthread_stackseg_np fails
(if GC_OPENBSD_THREADS).
* pthread_stop_world.c (GC_suspend_all): Get correct stack_ptr by
calling pthread_stackseg_np (subtracting ss_size from ss_sp) instead
of retrieving it from OpenBSD pthread implementation-dependent context
(if GC_OPENBSD_THREADS); remove comment.

2012-06-17 Ivan Maidanski <ivmai@mail.ru>

* tests/initsecondarythread.c: Include "private/config.h" if
HAVE_CONFIG_H (mostly to have GC_WIN32_PTHREADS defined for
pthreads-w32 target).
* tests/thread_leak_test.c: Likewise.
* tests/threadkey_test.c: Likewise.

2012-06-16 Ivan Maidanski <ivmai@mail.ru>

* tests/test_cpp.cc (WinMain): Prevent SEGV in strtok() by checking
"cmd" WinMain argument for NULL (in that case "argc" local variable is
set to 0).

2012-06-16 Ivan Maidanski <ivmai@mail.ru>

* tests/test_cpp.cc (main): Call GC_set_all_interior_pointers(1)
before GC_INIT to ensure that the collector considers pointers to
object interiors as valid ones (such a pointer could emerge as
a result of a type cast to subclass in case of multiple inheritance);
add comment.

[7.2c]

2012-06-11 Ivan Maidanski <ivmai@mail.ru>
Expand Down
9 changes: 4 additions & 5 deletions alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ GC_API GC_stop_func GC_CALL GC_get_stop_func(void)
/* collections to amortize the collection cost. */
static word min_bytes_allocd(void)
{
int dummy; /* GC_stackbottom is used only for a single-threaded case. */
# ifdef STACK_GROWS_UP
word stack_size = (ptr_t)(&dummy) - GC_stackbottom;
word stack_size = GC_approx_sp() - GC_stackbottom;
/* GC_stackbottom is used only for a single-threaded case. */
# else
word stack_size = GC_stackbottom - (ptr_t)(&dummy);
word stack_size = GC_stackbottom - GC_approx_sp();
# endif

word total_root_size; /* includes double stack size, */
Expand Down Expand Up @@ -579,7 +579,6 @@ GC_API int GC_CALL GC_collect_a_little(void)
STATIC GC_bool GC_stopped_mark(GC_stop_func stop_func)
{
unsigned i;
int dummy;
# ifndef SMALL_CONFIG
CLOCK_TYPE start_time = 0; /* initialized to prevent warning. */
CLOCK_TYPE current_time;
Expand Down Expand Up @@ -631,7 +630,7 @@ STATIC GC_bool GC_stopped_mark(GC_stop_func stop_func)
START_WORLD();
return(FALSE);
}
if (GC_mark_some((ptr_t)(&dummy))) break;
if (GC_mark_some(GC_approx_sp())) break;
}

GC_gc_no++;
Expand Down
Loading

0 comments on commit ebf3955

Please sign in to comment.