summaryrefslogtreecommitdiff
path: root/alloc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2019-04-23 22:21:54 +0300
committerIvan Maidanski <ivmai@mail.ru>2019-04-23 22:21:54 +0300
commitfa8b492e30a8161416c9362843c21d049735b848 (patch)
tree9e94f6901b011557c9722ce94e94bdf8394e8d08 /alloc.c
parenta8c5ee41a95a1a541f088582de909f537a6827d9 (diff)
downloadbdwgc-fa8b492e30a8161416c9362843c21d049735b848.tar.gz
Workaround 'duplicate expression for condition and assignment' cppcheck FP
The entitled cppcheck warnings are false positives. * alloc.c (GC_should_collect): Move reassignment of the global variable which is checked in the conditional expression to the end of the conditional block statement. * finalize.c (GC_notify_or_invoke_finalizers): Likewise. * mark.c [WRAP_MARK_SOME] (GC_mark_some): Likewise.
Diffstat (limited to 'alloc.c')
-rw-r--r--alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/alloc.c b/alloc.c
index a0c2a1c3..45fd0869 100644
--- a/alloc.c
+++ b/alloc.c
@@ -388,8 +388,8 @@ GC_INNER GC_bool GC_should_collect(void)
static word last_min_bytes_allocd;
static word last_gc_no;
if (last_gc_no != GC_gc_no) {
- last_gc_no = GC_gc_no;
last_min_bytes_allocd = min_bytes_allocd();
+ last_gc_no = GC_gc_no;
}
return(GC_adj_bytes_allocd() >= last_min_bytes_allocd
|| GC_heapsize >= GC_collect_at_heapsize);