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

fix: typos in docs #48

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion asmcall/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To avoid extensive checks, scheduling, and GC synchronization overhead, replacin

This package provides four functions (corresponding to 0~3 arguments). Handwritten assembly is used for Go stack switching and ABI conversion on AMD64 and ARM64 platforms. For other platforms, it falls back to a CGO implementation.

[fastcgo](https://github.com/petermattis/fastcgo) and [rustgo](https://words.filippo.io/rustgo/) were the first attempt at a similar optimization. Implemented seven years ago, it is no longer compatible with newer versions of the Go compiler. Drawing inspiration from fastcgo and refering to the Go runtime source code, I made a new implementation. The main differences include how the g pointer is switched, avoidance of asynchronous preemption, and added ARM64 assembly support.
[fastcgo](https://github.com/petermattis/fastcgo) and [rustgo](https://words.filippo.io/rustgo/) were the first attempt at a similar optimization. Implemented seven years ago, it is no longer compatible with newer versions of the Go compiler. Drawing inspiration from fastcgo and referring to the Go runtime source code, I made a new implementation. The main differences include how the g pointer is switched, avoidance of asynchronous preemption, and added ARM64 assembly support.

Core Principles:

Expand Down
4 changes: 2 additions & 2 deletions docs/trait-attrs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ author: ihciah

Now rust2go supports 3 attributes on trait's async function:
1. `#[send]`: the function will be generated as `impl Future<Output=..> + Send + Sync`. Use it when you need it.
2. `#[drop_safe]`: this makes the function safe, but requires all paramters passing ownership. Use it when you cannot make sure the future may cancel.
3. `#[drop_safe_ret]`: to make the function safe, it requires passing ownership; this attribute allow users to get the paramters ownership back. Use it when you cannot make sure the future may cancel, and you want to get back the parameters ownership after the calling.
2. `#[drop_safe]`: this makes the function safe, but requires all parameters passing ownership. Use it when you cannot make sure the future may cancel.
3. `#[drop_safe_ret]`: to make the function safe, it requires passing ownership; this attribute allow users to get the parameters ownership back. Use it when you cannot make sure the future may cancel, and you want to get back the parameters ownership after the calling.
4. `#[mem]` or `#[shm]`: make this function implemented based on shared memory, whose performance is highly improved(but it requires unix now). Unless you find obvious performance bottlenecks, there is no need to enable it.
5. `#[go_pass_struct]`: make the generated go side code use pointer instead of value at parameters. This is useful when the parameter is large. This does not affect the rust side code. It is not recommended to enable this unless you explicitly want to pass the structure itself.
6. `#[cgo_callback]`: make the generated go side code use CGO based method instead of ASM. It is not recommended to enable it unless you find some failures caused by ASMCALL.
Expand Down
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Rust2Go Intergrated Test
# Rust2Go Integrated Test

Loading