-
Notifications
You must be signed in to change notification settings - Fork 721
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
Unsafe variable pointer #1691
Unsafe variable pointer #1691
Conversation
22cdea2
to
1f2dad6
Compare
Permit offset + size == len. Detect integer overflow in offset + size. Signed-off-by: Nick Zavaritsky <[email protected]>
Enable (unsafe) direct access to mmap-ed variable memory. It makes scanning large data areas more efficient and enables advanced synchronisation patterns, such as atomics. Introduce a new package so that a user has to explicitly opt in for unsafe features. Signed-off-by: Nick Zavaritsky <[email protected]>
1f2dad6
to
65932b7
Compare
My plan was to revive #1607 (the VariablePointer part) and put it behind a CollectionOptions flag. We're not going to commit to this sort of API. |
end := size - 1 | ||
end := size | ||
|
||
qt.Assert(t, qt.IsTrue(mm.bounds(0, 0))) | ||
qt.Assert(t, qt.IsTrue(mm.bounds(end, 0))) | ||
qt.Assert(t, qt.IsFalse(mm.bounds(end, 0))) | ||
qt.Assert(t, qt.IsTrue(mm.bounds(end-8, 8))) | ||
qt.Assert(t, qt.IsTrue(mm.bounds(0, end))) | ||
|
||
qt.Assert(t, qt.IsFalse(mm.bounds(end-8, 9))) | ||
qt.Assert(t, qt.IsFalse(mm.bounds(end, 1))) | ||
qt.Assert(t, qt.IsFalse(mm.bounds(0, size))) | ||
qt.Assert(t, qt.IsTrue(mm.bounds(0, size))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I fail to understand something? Especially qt.IsFalse(mm.bounds(0, size)))
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix posted in #1694.
To double-check we are on the same page: did you plan to add it before the proposal gets through? Even if it gets accepted it is taking at least another two years before the feature becomes available in Golang and cilium/ebpf bumps its minimum requirement. If the collection option is omitted, does the IMO it is cleaner to have a separate package than to introduce a method that fails by default. What if the proposal is rejected? Do we rip out the The @lmb ? |
@mejedi To confirm what we discussed offline: the proposal has gotten positive traction, and mknyszek told me the feature has a decent chance of making it into the runtime. I'll push to get it formally accepted, it needs a few edits. Then, it's a matter of getting it implemented. nack on adding an |
Enable (unsafe) direct access to mmap-ed variable memory. It makes scanning large data areas more efficient and enables advanced synchronisation patterns, such as atomics.
Introduce a new package so that a user has to explicitly opt in for unsafe features.