For thread-local variables and associative arrays, the documentation says that unassigned variables are considered to be initialized to zero. Storage is not allocated until nonzero values are assigned. Storage is to be freed when zero values are assigned.
These semantics are not well handled for struct variables. Consider
struct foo {
int bar, baz;
} x;
We cannot assign zero to x to free its storage since x=0 is not defined. And we cannot initialize a member x.bar=1 unless x already exists.
These issues are not new to the port of DTrace onto BPF. They existed already in the legacy DTrace implementation on Linux.
For thread-local variables and associative arrays, the documentation says that unassigned variables are considered to be initialized to zero. Storage is not allocated until nonzero values are assigned. Storage is to be freed when zero values are assigned.
These semantics are not well handled for struct variables. Consider
We cannot assign zero to x to free its storage since x=0 is not defined. And we cannot initialize a member x.bar=1 unless x already exists.
These issues are not new to the port of DTrace onto BPF. They existed already in the legacy DTrace implementation on Linux.