Comments (7)
I'm not sure if the forget()
call is the right approach here. I would expect it to leak as element
won't have its destructor run. @tov do you perhaps know more about this?
from libffi-rs.
The problem is that the low::ffi_type
of element
is copied to new, but then element
is dropped and the ffi_type
deallocated.
I tried changing the loop to *new.add(i) = ffi_type_clone(*element.0);
and it also works.
Since Type::drop
only deallocates it's type and in this case the type is already copied, I think it should be safe, but I might be wrong.
from libffi-rs.
@xtldr Ah, in that case feel free to set up a pull request and I'll include the changes :)
from libffi-rs.
@YorickPeterse I have set up a pull request. I'm new to GitHub, so if there are any problems with it please let me know.
from libffi-rs.
@xtldr It seems you submitted the PR to your own fork (xtldr#1), instead of this project. I'm not sure if you can change an existing PR, so you may need to set up a new one. IIRC the way to do that is to go to this project, then create a PR from there.
from libffi-rs.
@YorickPeterse Yeah, I got confused when Github offered to create a pull request when I used the online editor for creating the patch. I did a new pull request against this repo, and it seems ok.
from libffi-rs.
Fixed in #23, which has been released on crates.io
from libffi-rs.
Related Issues (20)
- libffi-sys refuses to build with gnu toolchain on Windows HOT 16
- PowerPC builds are failing with a core dump HOT 1
- Fix the link to 'C libffi documentation' HOT 1
- `.code_ptr()` method unsound HOT 5
- libffi-sys-rs fails to build on OpenBSD amd64 HOT 5
- Outdated version of vendored `libffi` causes build error on macOS Big Sur with M1 processor HOT 1
- Unnecessary build dependency on autotools HOT 2
- `high` interface soundness HOT 19
- Get function pointer from high-level `FnPtrX` HOT 4
- Support libffi error status FFI_BAD_ARGTYPE
- Should low::CodePtr be repr(transparent)?
- `libffi-sys` fails to build on `riscv64gc-unknown-linux-gnu` HOT 2
- Support for creating closures that take bindgen generated types HOT 1
- unresolved import `crate::raw::ffi_type_longdouble` HOT 6
- How to safely use the middle API when the signature isn't known until runtime. HOT 3
- middle::Cif needs a variadic variation for its new function HOT 1
- Support function pointer type HOT 3
- Kernel `windows` not known to work with OS `gnu` HOT 4
- Structure argument data gets corrupted on cloning `libffi::middle::Cif` HOT 1
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 libffi-rs.