-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add BatchLookup support for a pointer to a slice #1290
Comments
Could it be that it's the intended outcome? I read it as |
You are right, I misread the comment. That being said, the later functions do work with a pointer to a slice: ebpf/internal/sysenc/marshal.go Lines 144 to 146 in 99a4e69
|
Reworded to be a feature request |
One of the motivations here is to avoid the 24 byte allocation necessary to pass the slice by value. |
Can you add an example? The idea with BatchLookup is to use |
I think you are talking specifically about per-CPU, but my request applies even for normal maps. |
Example:
|
Okay, I guess that is because the slice headers need to go onto the heap since we turn them into Lines 156 to 164 in 394be60
The problem with pointer-to-slice for per-CPU maps is that they already have semantics for non-batch lookups. For legacy reasons they will cause the library to allocate the target slice. If we added pointer-to-slice for BatchLookup it would have to match those semantics so that we don't fully descend into madness (I already find it difficult to keep the rules straight). That in turn means it wouldn't be very useful for you due to additional allocations. |
BatchLookup
claims it doesn't support a pointer to a slice, butsysenc.SyscallOutput
does support pointers to slices:ebpf/internal/sysenc/marshal.go
Lines 144 to 146 in 99a4e69
Could
batchCount
andsliceLen
be updated to support pointer to slices?The text was updated successfully, but these errors were encountered: