You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a struct field has a semantic serialization function defined, the whole structure must implement Clone. This is inefficient and can also cause trouble when having also a FamStructWrapper<T> field defined in that structure.
Calling clone() on a FamStructWrapper<T> instance will clone only the number of entries and the flexible array members. For example, if we have the following structure:
clone() will be called before we actually serialize the fields and because of this, we will serialize the default value for padding field, not the value that we pass when we instantiate S.
The text was updated successfully, but these errors were encountered:
We should definitely check if we can relax the restrictions on the Versionize interface so that clone is not needed.
At the same time, having FamStruct clone implemented in such a way that it is only "cloning" the number of entries and the actual entries doesn't seem correct to me. Can you also open an issue in vmm-sys-util so that we can fix it (or remove the autogenerated clone)?
If a struct field has a semantic serialization function defined, the whole structure must implement
Clone
. This is inefficient and can also cause trouble when having also aFamStructWrapper<T>
field defined in that structure.Calling
clone()
on aFamStructWrapper<T>
instance will clone only the number of entries and the flexible array members. For example, if we have the following structure:wrapped in a
FamStructWrapper
and we callclone()
on it, onlynent
andentries
fields will be kept (padding
field will take the default u32 value).So, if we want to serialize the following structure:
clone()
will be called before we actually serialize the fields and because of this, we will serialize the default value forpadding
field, not the value that we pass when we instantiateS
.The text was updated successfully, but these errors were encountered: