Big string / big record support #2853
Labels
enhancement
New feature or request, changes on existing features
language
Changes to the bpftrace language
llvm
Issue may involve writing llvm assembly
RFC
Request for comment
Take, for example, this:
The reason is
curtask
dereference puts the entire struct on the stack.Which not only doesn't fit, but does not qualify for unrolled memset builtin.
One potential way to handle this is to use the new
createGetScratchMap()
infrastructure to "allocate" memory in
unop_ptr()
instead of from the stack.But the drawback is that we can only have a single live allocation at a time.
Meaning, something like this would not be possible:
However, something like this could be possible:
That is b/c in the second example the lifetimes of
$one
and$two
are disjoint.I think above is a good starting point for big string / big record support.
We can do some basic lifetime analysis in semantic analyser (or a new pass?)
and error out if there's overlap.
In the future we can allocate as many scratch maps as we need (perhaps up
to a certain limit).
I'm not sure I've covered all the cases. But I think this is something good
to think about.
The text was updated successfully, but these errors were encountered: