Allocate a mgc reference and save it