Comments (3)
Note that the current implementation leverages generic code by generating distinct asm blocks for each concrete callback F
.
It wouldn't be reasonable to do that via C code. But we don't have to; we can make the generic C version take the closure environment and the closure code pointer as explicit arguments, and then do the call itself. Its hypothetically a performance hit to do that, but my gut tells me that its not a noticeable performance hit: either you have LTO turned on, in which case I hope you'd see enough inlining to boil away the indirection, or you have LTO turned off, in which case you won't see any cross-language inlining anyway and I doubt you'd care about an indirect vs direct call.
from cee-scape.
This seems like a reasonable thing to do. To me it would make sense to fall back to C for unrecognized architectures, or to allow forcing the C version with a feature flag. That would be a nice safety net in case we discover an obscure bug with either the C version or the asm version.
from cee-scape.
Addressed by #21
from cee-scape.
Related Issues (18)
- call_with_sigsetjmp should be toggleable via a feature flag HOT 2
- Todo: ARM support HOT 4
- Todo: Windows support HOT 1
- Todo: docs.rs integration HOT 1
- Todo: CI builds and testing HOT 3
- to consider: use ui_test crate for the compile_fail tests?
- inline asm is probably broken for PIC HOT 2
- Todo: add test of Position Independent Code (PIC)
- misuse of named arguments broke build atop rust 1.69 HOT 2
- need stronger clobber annotation for explicitly referenced registers HOT 3
- to consider: avoid `(0|1)*` as asm local label HOT 1
- `longjmp()` and register clobbering HOT 3
- does closure_env_ptr.read() imply we need a forget elsewhere? HOT 3
- todo: audit code against the `&Header` problem
- future proofing: use ManuallyDrop rather than mem::forget for callback management HOT 1
- -
- Feature request: add support for RISCV64
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cee-scape.