RTS allocation sites do not try GCing before failing
While working on the IO manager, @duncan and I noticed that various large allocation sites within primops may fail spuriously when +RTS -M... is used. Specifically, these primops call allocateMayFail and on failure immediately throw an exception. However, it is possible that the allocation would have succeeded if we first attempted to GC.
The following primops exhibit this pathology:
stg_newPinnedByteArrayzhstg_newByteArrayzhstg_newAlignedPinnedByteArrayzhstg_newArrayzhstg_newSmallArrayzhstg_unpackClosurezh
Edited by Ben Gamari