Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add storage offset support in dt_ident_t and dt_idhash_t
Variables (especially of a complex type) and aggregations will need to be allocated from a memory block. They will therefore require a storage offset to be associated with them so that the code generator can access the correct memory locations. The dt_ident_t structure now has a di_offset member to hold the storage offset for the identifier (if applicable) and the dt_idhash_t structure has a dh_nextoff member to hold the offset to allocate the next item at. The dt_idhash_nextoff(dt_idhash_t *dhp, uint_t alignment, uint_t size) function will return the offset where the next data item is to be allocated. The size argument specifies the size (in bytes) of the data item. The returned value is guaranteed to be properly aligned to the number of bytes specified by the alignment argument, and the next offset member (dh_nextoff in dt_idhash_t) will be advanced by the given number of bytes. Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com> Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
- Loading branch information