allocmem etc. moved behind commit