Giter VIP home page Giter VIP logo

Comments (5)

justbuchanan avatar justbuchanan commented on June 14, 2024 1

Yep, that's a memory leak! Good find. @ashaw596, you're right - it would probably be better to store the nodes directly in the vector rather than via pointer. It would be more efficient and a little simpler too.

from rrt.

ashaw596 avatar ashaw596 commented on June 14, 2024

Nice catch! I think your're right. @justbuchanan @joshhting Is there any particular reason _nodes its a vector of Node* instead of just Node?

from rrt.

jgkamat avatar jgkamat commented on June 14, 2024

I think that it needs to be a Node* because otherwise we'll need to store all the nodes on the stack (or have a pointer to a vector). Does vector automagically put things in the heap for you? I'm not sure.

@SiyuanQi Thanks! that definetly looks like a problem. If you want, you can submit a pull request if you're sure about it, you did find it after all 😄

@joshhting can you verify that this is actually a memory leak? It looks like it is to me at a first glance (I don't have enough time to look at it too closely 😢)

from rrt.

ashaw596 avatar ashaw596 commented on June 14, 2024

I mean vector allocates everything on the heap anyways so that shouldn't be an issue. Why don't we just change it to a normal vector? Is there any weird ownership stuff thats going on?

from rrt.

jgkamat avatar jgkamat commented on June 14, 2024

I don't think there is, but josh or justin probably would have a better idea. In that case we might want to refactor that (but after we merge the PR's justin is submitting).

from rrt.

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.