[DTrace-devel] [PATCH v2] Implement TLS variables

Kris Van Hees kris.van.hees at oracle.com
Wed Nov 24 05:22:14 UTC 2021


Hm, could catch.  I totally forgot about the 'assign 0' behaviour.  That is
an easy fix, so that will be in v3.  Since I am off until next Monday, I'll
post v3 by then.

On Tue, Nov 23, 2021 at 08:00:24PM -0500, Eugene Loh via DTrace-devel wrote:
> I'm also curious about the status of "zero values."  That is, space should
> not be allocated until nonzero values are assigned. Further, space should be
> freed when zero values are assigned.
> 
> E.g.,
> 
> #pragma D option dynvarsize=1024
> BEGIN {
>   self->a = 101;
>   self->b = 102;
>   self->c = 103;
>   exit(0);
> }
> 
> works.  (1024 bytes where each value consumes just over 256 bytes.  So room
> for 3 values.)  Great.  But
> 
> #pragma D option dynvarsize=1024
> BEGIN {
>   self->a = 101;
>   self->b = 102;
>   self->c = 103;
>   self->d = 104;
>   exit(0);
> }
> 
> fails.  Okay.  Makes sense.  The failure mode is different from legacy
> DTrace (as is the dynvarsize value), but no matter.  But:
> 
> #pragma D option dynvarsize=1024
> BEGIN {
>   self->a = 101;
>   self->b = 102;
>   self->c = 103;
>   self->a =   0;
>   self->b =   0;
>   self->c =   0;
>   self->d = 104;
>   exit(0);
> }
> 
> also fails, even though space presumably has been freed.  To be fair, I
> cannot vouch for legacy DTrace's handling of this case. Anyhow,
> 
> #pragma D option dynvarsize=1024
> BEGIN {
>   self->a =   0;
>   self->b =   0;
>   self->c =   0;
>   self->d =   0;
>   exit(0);
> }
> 
> also fails, even though no space should be consumed.
> 
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list