Better allocation strategy in isamh_merge