From: ivmai Date: Thu, 30 Jun 2011 15:29:25 +0000 (+0000) Subject: 2011-06-30 Ivan Maidanski X-Git-Tag: gc7_3alpha2~419 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45a388771686fd791fc753fa877fc794b04d3c32;p=gc 2011-06-30 Ivan Maidanski * pthread_support.c (GC_segment_is_thread_stack): Replace '&' operator with '&&' one in conditional expressions. * specific.c (remove_specific): Dereference "entry" local variable only if it is non-NULL. * include/gc.h (GC_NEW): Refine the comment (about the returned value). --- diff --git a/ChangeLog b/ChangeLog index 54fe9318..f5423602 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-06-30 Ivan Maidanski + + * pthread_support.c (GC_segment_is_thread_stack): Replace '&' + operator with '&&' one in conditional expressions. + * specific.c (remove_specific): Dereference "entry" local variable + only if it is non-NULL. + * include/gc.h (GC_NEW): Refine the comment (about the returned + value). + 2011-06-15 Ivan Maidanski * include/gc_version.h, configure.ac, doc/README: Change to diff --git a/include/gc.h b/include/gc.h index 3e3f56e3..ae7d046f 100644 --- a/include/gc.h +++ b/include/gc.h @@ -717,7 +717,8 @@ GC_API void * GC_CALL GC_debug_realloc_replacement(void * /* object_addr */, /* The following are included because they are often convenient, and */ /* reduce the chance for a misspecified size argument. But calls may */ /* expand to something syntactically incorrect if t is a complicated */ -/* type expression. */ +/* type expression. Note that, unlike C++ new operator, these ones */ +/* may return NULL (if out of memory). */ #define GC_NEW(t) ((t*)GC_MALLOC(sizeof(t))) #define GC_NEW_ATOMIC(t) ((t*)GC_MALLOC_ATOMIC(sizeof(t))) #define GC_NEW_STUBBORN(t) ((t*)GC_MALLOC_STUBBORN(sizeof(t))) diff --git a/pthread_support.c b/pthread_support.c index 33e37924..f9af3029 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -652,9 +652,9 @@ STATIC void GC_remove_all_threads_but_me(void) GC_ASSERT(I_HOLD_LOCK()); # ifdef PARALLEL_MARK for (i = 0; i < GC_markers - 1; ++i) { - if (marker_sp[i] > lo & marker_sp[i] < hi) return TRUE; + if (marker_sp[i] > lo && marker_sp[i] < hi) return TRUE; # ifdef IA64 - if (marker_bsp[i] > lo & marker_bsp[i] < hi) return TRUE; + if (marker_bsp[i] > lo && marker_bsp[i] < hi) return TRUE; # endif } # endif diff --git a/specific.c b/specific.c index cbeb2331..98d86c31 100644 --- a/specific.c +++ b/specific.c @@ -82,8 +82,8 @@ void PREFIXED(remove_specific) (tsd * key) { } /* Invalidate qtid field, since qtids may be reused, and a later */ /* cache lookup could otherwise find this entry. */ - entry -> qtid = INVALID_QTID; if (entry != NULL) { + entry -> qtid = INVALID_QTID; *link = entry -> next; /* Atomic! concurrent accesses still work. */ /* They must, since readers don't lock. */