From 728b48254bf4e3979a2e4c6cd667ace5cd020d12 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 30 May 2016 20:44:10 +0200 Subject: erts: Fix ASSERT provoked by map_SUITE:t_rare_map_overflow The same bug was fixed for OTP 18 in cb62c989e59f0ec8556f9f1d4e9a45b by provoking yet another GC. But now in 19 we are ok with heap fragments so just remove the asserts. --- erts/emulator/beam/erl_gc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c index c7bbbd5ca0..9da82f9bf2 100644 --- a/erts/emulator/beam/erl_gc.c +++ b/erts/emulator/beam/erl_gc.c @@ -1198,7 +1198,6 @@ minor_collection(Process* p, ErlHeapFragment *live_hf_end, done: ASSERT(HEAP_SIZE(p) == next_heap_size(p, HEAP_SIZE(p), 0)); - ASSERT(MBUF(p) == NULL); /* The heap usage during GC should be larger than what we end up after a GC, even if we grow it. If this assertion is not true @@ -1591,6 +1590,9 @@ major_collection(Process* p, ErlHeapFragment *live_hf_end, HIGH_WATER(p) = HEAP_TOP(p); +#ifdef HARDDEBUG + disallow_heap_frag_ref_in_heap(p); +#endif remove_message_buffers(p); if (p->flags & F_ON_HEAP_MSGQ) @@ -1603,9 +1605,6 @@ major_collection(Process* p, ErlHeapFragment *live_hf_end, adjusted = adjust_after_fullsweep(p, need, objv, nobj); -#ifdef HARDDEBUG - disallow_heap_frag_ref_in_heap(p); -#endif ErtsGcQuickSanityCheck(p); return gc_cost(size_after, adjusted ? size_after : 0); -- cgit v1.2.3 From ca3c71f3e22b93bc633562d0d1a2f6479c21b223 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 30 May 2016 20:49:04 +0200 Subject: erts: Clean up some goto spaghetti and replace with a nice else-if chain. --- erts/emulator/beam/erl_gc.c | 17 +++++------------ 1 file 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 -- cgit v1.2.3