Git Product home page Git Product logo

Comments (7)

YorickPeterse avatar YorickPeterse commented on May 22, 2024

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.

xtldr avatar xtldr commented on May 22, 2024

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.

YorickPeterse avatar YorickPeterse commented on May 22, 2024

@xtldr Ah, in that case feel free to set up a pull request and I'll include the changes :)

from libffi-rs.

xtldr avatar xtldr commented on May 22, 2024

@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.

YorickPeterse avatar YorickPeterse commented on May 22, 2024

@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.

xtldr avatar xtldr commented on May 22, 2024

@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.

YorickPeterse avatar YorickPeterse commented on May 22, 2024

Fixed in #23, which has been released on crates.io

from libffi-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.