optimisation to freeGroup() to avoid an O(N^2) pathalogical case In the free list, we don't strictly speaking need to have every block in a coalesced group point to the head block, although this is an invariant for non-free blocks.  Dropping this invariant for the free list means that coalesce() is O(1) rather than O(N), and freeGroup() is therefore O(N) not O(N^2).
optimisation to freeGroup() to avoid an O(N^2) pathalogical case
In the free list, we don't strictly speaking need to have every block
in a coalesced group point to the head block, although this is an
invariant for non-free blocks.  Dropping this invariant for the free
list means that coalesce() is O(1) rather than O(N), and freeGroup()
is therefore O(N) not O(N^2).

The bad case probably didn't happen most of the time, indeed it has
never shown up in a profile that I've seen.  I had a report from a
while back that this was a problem with really large heaps, though.
Fortunately the fix is easy.

frantisekfarka/ghc-dsi,da-x/ghc,christiaanb/ghc,shlevy/ghc,holzensp/ghc,mfine/ghc,ezyang/ghc,sgillespie/ghc,nushio3/ghc,frantisekfarka/ghc-dsi,fmthoma/ghc,snoyberg/ghc,AlexanderPankiv/ghc,ekmett/ghc,christiaanb/ghc,spacekitteh/smcghc,TomMD/ghc,mettekou/ghc,mcmaniac/ghc,sdiehl/ghc,vikraman/ghc,gridaphobe/ghc,acowley/ghc,shlevy/ghc,wxwxwwxxx/ghc,lukexi/ghc,green-haskell/ghc,christiaanb/ghc,spacekitteh/smcghc,siddhanathan/ghc,ghc-android/ghc,AlexanderPankiv/ghc,vikraman/ghc,jstolarek/ghc,sdiehl/ghc,shlevy/ghc,urbanslug/ghc,bitemyapp/ghc,wxwxwwxxx/ghc,hferreiro/replay,oldmanmike/ghc,ezyang/ghc,lukexi/ghc,ml9951/ghc,tibbe/ghc,tjakway/ghcjvm,da-x/ghc,siddhanathan/ghc,olsner/ghc,urbanslug/ghc,green-haskell/ghc,lukexi/ghc-7.8-arm64,GaloisInc/halvm-ghc,gcampax/ghc,TomMD/ghc,mfine/ghc,mcschroeder/ghc,ryantm/ghc,GaloisInc/halvm-ghc,nathyong/microghc-ghc,oldmanmike/ghc,acowley/ghc,frantisekfarka/ghc-dsi,ezyang/ghc,nushio3/ghc,holzensp/ghc,lukexi/ghc-7.8-arm64,ghc-android/ghc,da-x/ghc,AlexanderPankiv/ghc,tibbe/ghc,forked-upstream-packages-for-ghcjs/ghc,nushio3/ghc,forked-upstream-packages-for-ghcjs/ghc,ilyasergey/GHC-XAppFix,tjakway/ghcjvm,ezyang/ghc,olsner/ghc,nomeata/ghc,mcschroeder/ghc,da-x/ghc,gridaphobe/ghc,olsner/ghc,acowley/ghc,elieux/ghc,olsner/ghc,urbanslug/ghc,ryantm/ghc,ml9951/ghc,vikraman/ghc,tjakway/ghcjvm,shlevy/ghc,hferreiro/replay,vTurbine/ghc,gcampax/ghc,oldmanmike/ghc,christiaanb/ghc,elieux/ghc,vTurbine/ghc,ryantm/ghc,ghc-android/ghc,tibbe/ghc,gcampax/ghc,vikraman/ghc,AlexanderPankiv/ghc,TomMD/ghc,TomMD/ghc,fmthoma/ghc,siddhanathan/ghc,anton-dessiatov/ghc,sdiehl/ghc,spacekitteh/smcghc,anton-dessiatov/ghc,fmthoma/ghc,mettekou/ghc,mfine/ghc,GaloisInc/halvm-ghc,gcampax/ghc,mettekou/ghc,mfine/ghc,acowley/ghc,wxwxwwxxx/ghc,GaloisInc/halvm-ghc,ml9951/ghc,nkaretnikov/ghc,elieux/ghc,lukexi/ghc,gcampax/ghc,wxwxwwxxx/ghc,nkaretnikov/ghc,GaloisInc/halvm-ghc,da-x/ghc,tibbe/ghc,mcschroeder/ghc,shlevy/ghc,ekmett/ghc,fmthoma/ghc,tibbe/ghc,fmthoma/ghc,christiaanb/ghc,ml9951/ghc,snoyberg/ghc,tjakway/ghcjvm,jstolarek/ghc,lukexi/ghc,wxwxwwxxx/ghc,sdiehl/ghc,forked-upstream-packages-for-ghcjs/ghc,mcmaniac/ghc,mettekou/ghc,christiaanb/ghc,anton-dessiatov/ghc,snoyberg/ghc,mcschroeder/ghc,nomeata/ghc,ekmett/ghc,frantisekfarka/ghc-dsi,sdiehl/ghc,ghc-android/ghc,anton-dessiatov/ghc,shlevy/ghc,mcschroeder/ghc,spacekitteh/smcghc,ghc-android/ghc,bitemyapp/ghc,lukexi/ghc-7.8-arm64,vTurbine/ghc,anton-dessiatov/ghc,sgillespie/ghc,ghc-android/ghc,ezyang/ghc,forked-upstream-packages-for-ghcjs/ghc,nushio3/ghc,mcschroeder/ghc,mfine/ghc,AlexanderPankiv/ghc,sdiehl/ghc,gcampax/ghc,gridaphobe/ghc,acowley/ghc,ml9951/ghc,ml9951/ghc,frantisekfarka/ghc-dsi,nomeata/ghc,siddhanathan/ghc,sgillespie/ghc,holzensp/ghc,mfine/ghc,oldmanmike/ghc,holzensp/ghc,urbanslug/ghc,sdiehl/ghc,urbanslug/ghc,snoyberg/ghc,wxwxwwxxx/ghc,oldmanmike/ghc,nathyong/microghc-ghc,siddhanathan/ghc,hferreiro/replay,green-haskell/ghc,bitemyapp/ghc,forked-upstream-packages-for-ghcjs/ghc,forked-upstream-packages-for-ghcjs/ghc,christiaanb/ghc,bitemyapp/ghc,siddhanathan/ghc,wxwxwwxxx/ghc,ezyang/ghc,spacekitteh/smcghc,olsner/ghc,anton-dessiatov/ghc,ryantm/ghc,da-x/ghc,GaloisInc/halvm-ghc,nushio3/ghc,nomeata/ghc,mcmaniac/ghc,mettekou/ghc,jstolarek/ghc,TomMD/ghc,ekmett/ghc,mettekou/ghc,urbanslug/ghc,jstolarek/ghc,nomeata/ghc,gridaphobe/ghc,tjakway/ghcjvm,vTurbine/ghc,bitemyapp/ghc,forked-upstream-packages-for-ghcjs/ghc,tjakway/ghcjvm,ekmett/ghc,anton-dessiatov/ghc,gcampax/ghc,TomMD/ghc,nkaretnikov/ghc,olsner/ghc,urbanslug/ghc,AlexanderPankiv/ghc,acowley/ghc,jstolarek/ghc,hferreiro/replay,lukexi/ghc-7.8-arm64,fmthoma/ghc,green-haskell/ghc,elieux/ghc,siddhanathan/ghc,sgillespie/ghc,nushio3/ghc,ilyasergey/GHC-XAppFix,fmthoma/ghc,oldmanmike/ghc,mcschroeder/ghc,ml9951/ghc,shlevy/ghc,olsner/ghc,AlexanderPankiv/ghc,sgillespie/ghc,ilyasergey/GHC-XAppFix,nkaretnikov/ghc,TomMD/ghc,hferreiro/replay,vikraman/ghc,nathyong/microghc-ghc,gridaphobe/ghc,vikraman/ghc,nkaretnikov/ghc,nathyong/microghc-ghc,holzensp/ghc,sgillespie/ghc,elieux/ghc,nathyong/microghc-ghc,ryantm/ghc,mcmaniac/ghc,nathyong/microghc-ghc,snoyberg/ghc,nkaretnikov/ghc,nkaretnikov/ghc,lukexi/ghc-7.8-arm64,elieux/ghc,tjakway/ghcjvm,mcmaniac/ghc,nathyong/microghc-ghc,vTurbine/ghc,elieux/ghc,mfine/ghc,vTurbine/ghc,hferreiro/replay,vikraman/ghc,sgillespie/ghc,ml9951/ghc,ilyasergey/GHC-XAppFix,snoyberg/ghc,mettekou/ghc,hferreiro/replay,GaloisInc/halvm-ghc,gridaphobe/ghc,snoyberg/ghc,da-x/ghc,ghc-android/ghc,oldmanmike/ghc,acowley/ghc,nushio3/ghc,ezyang/ghc,lukexi/ghc,green-haskell/ghc,vTurbine/ghc,gridaphobe/ghc