reduce the number of calls to bsal_allocate

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>