swap allocation