[DTrace-devel] [PATCH 02/20] Fix alignment of global and local variables

Eugene Loh eugene.loh at oracle.com
Mon Jun 7 23:16:29 PDT 2021


I'll try to look at this more, but don't really understand this stuff.  
A few initial comments and questions, though.

dt_cook_op1() still has a set_storage() call with 8-byte alignment.  
Does it need to be updated?

In dt_cook_op2(), there is an "alignment = 9;".  Maybe that's right, but 
I'm used to seeing 8.  It's obviously right or wrong... just too tired 
right now to figure out which.

The two tests test/unittest/variables/lvar/tst.alignment-struct[-2].sh say
ASSERTION: Variables of array type should be aligned based on their 
element datatype
Array type?  Is that a cut-and-paste vestige that should say struct?

In general, any way of reducing all that redundancy in the new tests?  
E.g., so that if someone wants to make a small change, they don't have 
to go through all those nearly redundant files?

On 6/2/21 1:47 AM, Kris Van Hees wrote:
> Storage for global and local variables was allocated at a 8-byte
> boundary regardless of the dattype of the variables.  We now use
> the proper alignment for each specific variable based on its
> datatype.

dattype -> datatype

> This patch also corrects the expected output for the tst.basics.d
> arithmetic test.

Can you remind me why?  The test used to behave like DTv1.  Now like 
GCC.  So, DTv1 was wrong?



More information about the DTrace-devel mailing list