diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2023-01-20 23:48:21 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2023-01-24 11:38:44 +0300 |
commit | 564274514901f43f9b2e308c96ac8b835026a35d (patch) | |
tree | bb9b67c45316ce83acfcb7c2006bb293f3d34e8d /ptr_chck.c | |
parent | 9d00bac77558d340d2af1dfbe37829cc16667a06 (diff) | |
download | bdwgc-564274514901f43f9b2e308c96ac8b835026a35d.tar.gz |
Check highest bit of word using SIGNB instead of cast to signed_word
(refactoring)
* allchblk.c (GC_merge_unmapped): Replace overflow check
(signed_word)(sz1+sz2)>0 to !((sz1+sz2)&SIGNB).
* allchblk.c (GC_freehblk): Likewise.
* mark.c (GC_mark_from): Replace (signed_word)descr>=0 expression
to !(descr&SIGNB).
* ptr_chck.c (GC_is_visible): Likewise.
Diffstat (limited to 'ptr_chck.c')
-rw-r--r-- | ptr_chck.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -240,7 +240,7 @@ GC_API void * GC_CALL GC_is_visible(void *p) /* For now we just punt. */ break; case GC_DS_PER_OBJECT: - if ((signed_word)descr >= 0) { + if (!(descr & SIGNB)) { descr = *(word *)((ptr_t)base + (descr & ~GC_DS_TAGS)); } else { ptr_t type_descr = *(ptr_t *)base; |