summaryrefslogtreecommitdiff
path: root/allchblk.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-09-14 20:35:36 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-09-14 20:35:36 +0300
commit8fa589f2e2cabbc6df8f846bc3078378e627ccf6 (patch)
treefc140ee51dcf112f70959e919348e5afd4f0e97d /allchblk.c
parent1ac20db7bbdd47da1719f0ab8825d5301fd4e66a (diff)
downloadbdwgc-8fa589f2e2cabbc6df8f846bc3078378e627ccf6.tar.gz
Reduce scope of local variables used for assertion checking in add_to_fl
(refactoring) * allchblk.c [GC_ASSERTIONS && !USE_MUNMAP] (GC_add_to_fl): Put next, nexthdr, prev, prevhdr local variables definition and the related assertions to a block statement.
Diffstat (limited to 'allchblk.c')
-rw-r--r--allchblk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/allchblk.c b/allchblk.c
index f4e0358a..534dc6f8 100644
--- a/allchblk.c
+++ b/allchblk.c
@@ -387,7 +387,9 @@ STATIC void GC_add_to_fl(struct hblk *h, hdr *hhdr)
{
int index = GC_hblk_fl_from_blocks(divHBLKSZ(hhdr -> hb_sz));
struct hblk *second = GC_hblkfreelist[index];
+
# if defined(GC_ASSERTIONS) && !defined(USE_MUNMAP)
+ {
struct hblk *next = (struct hblk *)((word)h + hhdr -> hb_sz);
hdr * nexthdr = HDR(next);
struct hblk *prev = GC_free_block_ending_at(h);
@@ -396,8 +398,9 @@ STATIC void GC_add_to_fl(struct hblk *h, hdr *hhdr)
GC_ASSERT(nexthdr == 0 || !HBLK_IS_FREE(nexthdr)
|| (GC_heapsize & SIGNB) != 0);
/* In the last case, blocks may be too large to merge. */
- GC_ASSERT(prev == 0 || !HBLK_IS_FREE(prevhdr)
+ GC_ASSERT(NULL == prev || !HBLK_IS_FREE(prevhdr)
|| (GC_heapsize & SIGNB) != 0);
+ }
# endif
GC_ASSERT(modHBLKSZ(hhdr -> hb_sz) == 0);
GC_hblkfreelist[index] = h;