-
Notifications
You must be signed in to change notification settings - Fork 105
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
Refs #20
base: main
Are you sure you want to change the base?
Refs #20
Conversation
Correction: |
T: Sized, | ||
{ | ||
reff.free() | ||
} |
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.
Can remove the module-level fns now that they're methods
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.
Those functions exist as to be inclusive towards the C/C++ developer community. Those can be removed, but it will make Rust less accessible for that group.
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.
We ought to make them extern "C"
in that case
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.
Ye makes sense
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.
Ah, those have names which cannot be exported
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.
hmmm
maybe #[export(cve_rs_malloc)]
/free?
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.
No such attribute
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.
My bad, export_name
: https://doc.rust-lang.org/reference/abi.html#the-export_name-attribute
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.
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.
cargo mommy lmfao
Since this library is extremely popular, we need to keep safety and speed as top priorities, but also code quality :) (this is definitely real logic and not just me giving you a hard time) |
Dropping `Sync` requirement for a `Ref` to be `Send`+`Sync`
It's fearless, it's concurrent, and it's repr C.
For people who want to do manual memory management, there are now
new
andfree
functions which return and acceptRef<T>
. Those functions replicate how those work in C, allowing free moving and mutating.Essentially
Ref<T>
disables borrow checker. This addresses the criticism of Rust being a difficult to use language due to borrow checker enforcing safety rules, which, as we can deduce from the amount of memory-management-related CVEs, is a hard thing for human beings to manage.