Now you can create a copy like this:
var tempWrap = new Benchmark.Struct.JobStructWrapper();
tempWrap.Fill(in item);
var copyItem = tempWrap.GetValue();
But this way is slow.
You need to generate something like the following:
public static JobStruct DeepCopy(in JobStruct item)
{
var result = new JobStruct();
result.Int32 = item.Int32;
result.Int64 = item.Int64;
result.JobStruct2.Int32 = item.Int32;
result.JobStruct2.Int64 = item.Int64;
return result;
}
Usage:
var copyItem = JobStructHelper.DeepCopy(in item);