Skip to content
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

Remove usage of unsafe completely #20

Closed
Milo123459 opened this issue Dec 16, 2023 · 9 comments
Closed

Remove usage of unsafe completely #20

Milo123459 opened this issue Dec 16, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@Milo123459
Copy link

There is no reason for this crate to use unsafe code.

@null8626
Copy link
Owner

Would this be possible though? Because the crate also reads from a custom-made binary - which wouldn't be possible without some pointer arithmetic.

@null8626
Copy link
Owner

null8626 commented Apr 1, 2024

I'm afraid this is a wontfix, sorry.
The SAFETY comments and lots of testing should suffice!

@null8626 null8626 closed this as completed Apr 1, 2024
@null8626 null8626 added the wontfix This will not be worked on label Apr 1, 2024
@GnomedDev
Copy link

As seen by #24, safety comments and testing without miri will not make unsafe magically safe. I'm preparing a PR to remove the trivial unsafe, is there an acceptable performance loss or must it be 1-1? @null8626.

@null8626
Copy link
Owner

null8626 commented Apr 2, 2024

Hmm, alright then, do as you please!

A slight performance loss is fine.

@null8626 null8626 reopened this Apr 2, 2024
@null8626 null8626 removed the wontfix This will not be worked on label Apr 2, 2024
@null8626
Copy link
Owner

null8626 commented Apr 7, 2024

Hai! Any updates on this?

@null8626
Copy link
Owner

Sooo i've removed all unsafe code in the Rust, WebAssembly, and Node.js crates today! Some unsafe still persists in the Java and C/C++ crates as they are a cdylib in nature.

Feel free to give me feedback on the current codebase! @GnomedDev @Milo123459

@Milo123459
Copy link
Author

I think the next step would just be publishing a new release :)

@null8626
Copy link
Owner

A new release should be out later this month!

Thank you all for the advice! I will be more cautious with unsafe code. I apologize for closing this issue prematurely! ❤️

@null8626 null8626 added the enhancement New feature or request label Apr 12, 2024
@null8626
Copy link
Owner

The update is here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants