copy blocks to the heap since they may outlive the calling scope