It is impossible to answer this question without a full understanding of how each of these packed entries is used in your application code. This is the same as the query "Should I change this variable declaration from Int64 to Byte?"
Not knowing what values ββthe variable will expect and which are necessary to maintain the response, may be yes. Or it may not be so.
Similarly in your case. If the record is to be packaged, it should be left packaged. If it does not need to be packaged, then there is no harm not to pack it. If you are not sure or cannot tell, then the safest course is to leave them as they are.
As a guide to making this decision (if you decide to continue), situations where packaging or recommended packaging is required include:
- saving record values
- sharing record values ββwith [potentially] compiled code in different ways
- strict compatibility with external structures
- intentionally overlaying a mock type on another structured memory
This is not necessarily an exhaustive list, and what do they have in common:
- containing a series of values ββin adjacent bytes that any potential producer or consumer of a record should and can rely on without the possibility of intervention by the compiler or other factors.
What I would recommend is that (if possible and practical) you determine what the purpose of the packaging is in each case, and add documentation to the recording announcement itself to this document so that everyone in the future with the same question needed to complete this discovery process, for example:
type TSomeRecordType = packed record // This record must be packed as it is used for persistence .. end; TSomeExternType = packed record // This record must be packed as it is required to be compatible // in memory with an externally defined struct (ref: extern code docs) .. end;
source share