Added some memory management code for CaBLAT