diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-09-14 20:35:36 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-09-14 20:35:36 +0300 |
commit | 8fa589f2e2cabbc6df8f846bc3078378e627ccf6 (patch) | |
tree | fc140ee51dcf112f70959e919348e5afd4f0e97d /allchblk.c | |
parent | 1ac20db7bbdd47da1719f0ab8825d5301fd4e66a (diff) | |
download | bdwgc-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |