Rearrange allocation_mode selection logic to be the same as before