From a0252d680e67c6b60fe4ea67f363c8b111756168 Mon Sep 17 00:00:00 2001 From: ivmai Date: Fri, 5 Mar 2010 14:46:08 +0000 Subject: [PATCH] 2010-03-05 Ivan Maidanski (really Burkhard Linke) * os_dep.c (GC_get_stack_base): Add LOCK/UNLOCK() (since GC_find_limit_with_bound() should be called with the lock held). * backgraph.c (FOR_EACH_PRED): Fix a typo. --- ChangeLog | 6 ++++++ backgraph.c | 2 +- os_dep.c | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f44a243..c4755f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-03-05 Ivan Maidanski (really Burkhard Linke) + + * os_dep.c (GC_get_stack_base): Add LOCK/UNLOCK() (since + GC_find_limit_with_bound() should be called with the lock held). + * backgraph.c (FOR_EACH_PRED): Fix a typo. + 2010-03-05 Ivan Maidanski * alloc.c (GC_set_stop_func, GC_get_stop_func): Add diff --git a/backgraph.c b/backgraph.c index a432757..c496e00 100644 --- a/backgraph.c +++ b/backgraph.c @@ -176,7 +176,7 @@ GC_INLINE void pop_in_progress(ptr_t p) ptr_t q = GET_OH_BG_PTR(p); \ if (!((word)q & FLAG_MANY)) { \ if (q && !((word)q & 1)) s \ - /* !((word)q & 1) checks for a misnterpreted freelist link */ \ + /* !((word)q & 1) checks for a misinterpreted freelist link */ \ } else { \ back_edges *orig_be_ = (back_edges *)((word)q & ~FLAG_MANY); \ back_edges *be_ = orig_be_; \ diff --git a/os_dep.c b/os_dep.c index 963928c..55d2311 100644 --- a/os_dep.c +++ b/os_dep.c @@ -1299,6 +1299,9 @@ GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *b) # ifdef NEED_FIND_LIMIT int dummy; IF_CANCEL(int cancel_state;) + DCL_LOCK_STATE; + + LOCK(); DISABLE_CANCEL(cancel_state); /* May be unnecessary? */ # ifdef STACK_GROWS_DOWN b -> mem_base = GC_find_limit((ptr_t)(&dummy), TRUE); @@ -1309,6 +1312,7 @@ GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *b) b -> mem_base = GC_find_limit(&dummy, FALSE); # endif RESTORE_CANCEL(cancel_state); + UNLOCK(); return GC_SUCCESS; # else return GC_UNIMPLEMENTED; @@ -1716,7 +1720,7 @@ ptr_t GC_SysVGetDataStart(size_t max_page_size, ptr_t etext_addr) & ~((word)max_page_size - 1)); word page_offset = (text_end & ((word)max_page_size - 1)); volatile char * result = (char *)(next_page + page_offset); - /* Note that this isnt equivalent to just adding */ + /* Note that this isn't equivalent to just adding */ /* max_page_size to &etext if &etext is at a page boundary */ GC_setup_temporary_fault_handler(); -- 2.7.4