aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-05-30 20:49:04 +0200
committerSverker Eriksson <[email protected]>2016-05-30 20:49:04 +0200
commitca3c71f3e22b93bc633562d0d1a2f6479c21b223 (patch)
tree066c768012a8225f5fb745de80343bde2b567c26 /erts/emulator/beam
parent728b48254bf4e3979a2e4c6cd667ace5cd020d12 (diff)
downloadotp-ca3c71f3e22b93bc633562d0d1a2f6479c21b223.tar.gz
otp-ca3c71f3e22b93bc633562d0d1a2f6479c21b223.tar.bz2
otp-ca3c71f3e22b93bc633562d0d1a2f6479c21b223.zip
erts: Clean up some goto spaghetti
and replace with a nice else-if chain.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_gc.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index 9da82f9bf2..d0d74bbf44 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -1183,20 +1183,13 @@ minor_collection(Process* p, ErlHeapFragment *live_hf_end,
adjust_size = p->htop - p->heap;
}
- goto done;
}
+ else if (need_after > HEAP_SIZE(p)) {
+ grow_new_heap(p, next_heap_size(p, need_after, 0), objv, nobj);
+ adjust_size = p->htop - p->heap;
+ }
+ /*else: The heap size turned out to be just right. We are done. */
- if (HEAP_SIZE(p) >= need_after) {
- /*
- * The heap size turned out to be just right. We are done.
- */
- goto done;
- }
-
- grow_new_heap(p, next_heap_size(p, need_after, 0), objv, nobj);
- adjust_size = p->htop - p->heap;
-
- done:
ASSERT(HEAP_SIZE(p) == next_heap_size(p, HEAP_SIZE(p), 0));
/* The heap usage during GC should be larger than what we end up