Merge "Add exception check to AllocateInternalWithGc"