summaryrefslogtreecommitdiff
path: root/ptr_chck.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2021-12-02 07:52:18 +0300
committerIvan Maidanski <ivmai@mail.ru>2021-12-02 11:03:13 +0300
commit8c5cc147c893f42d531707afb1aa838c11459445 (patch)
tree71a31452e694a9b679c0f0aa300c9520500ba8b7 /ptr_chck.c
parentdb9f5a329de776992ce8cc6f9e580911cdb15f30 (diff)
downloadbdwgc-8c5cc147c893f42d531707afb1aa838c11459445.tar.gz
Do not call SET_HDR() to remove forwarding counts if none exists in hblk
Issue #237 (bdwgc). This also prevents writing zeros to GC_all_nils by GC_remove_counts(). * headers.c (GC_remove_counts): If HDR(h+1) is zero (and sz is at least one block) then assert that HDR() of other hbp elements is zero too and then return (w/o SET_HDR(hbp,0) invocation). * ptr_chck.c (GC_is_valid_displacement): Remove comment that if(p) is needed to avoid a data race.
Diffstat (limited to 'ptr_chck.c')
-rw-r--r--ptr_chck.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/ptr_chck.c b/ptr_chck.c
index a4298a81..88affde3 100644
--- a/ptr_chck.c
+++ b/ptr_chck.c
@@ -123,11 +123,7 @@ GC_API void * GC_CALL GC_is_valid_displacement(void *p)
word sz;
if (!EXPECT(GC_is_initialized, TRUE)) GC_init();
-
- /* A quick check to avoid TSan report about the data race */
- /* between GC_find_header() and GC_remove_counts(). */
if (NULL == p) return NULL;
-
hhdr = HDR((word)p);
if (hhdr == 0) return(p);
h = HBLKPTR(p);