Git Product home page Git Product logo

Comments (6)

romainguy avatar romainguy commented on May 7, 2024

Indeed, thanks for the report!

from filament.

elfring avatar elfring commented on May 7, 2024

Would you like to check if any similar update candidates were left over in the source code for other software components?

from filament.

romainguy avatar romainguy commented on May 7, 2024

I'm sure there are other instances. I'd love to know about them if it's not too much work for you to look for them. Otherwise I'll take a look myself.

from filament.

elfring avatar elfring commented on May 7, 2024

How do you think about to recheck the need for null pointer checks before calls of resource release functions (like “free”) with the help of the semantic patch language (for example)?

from filament.

pixelflinger avatar pixelflinger commented on May 7, 2024

@elfring Note that there are a few places in filament where we intentionally check for nullptr before free() for performance reason. This is because a call to free() is expensive -- .so calls are actually pretty heavy, they cost the equivalent of a jump + global variable dereference + function pointer branch. So in case where the call to free() is NOT the common case, it's preferable to check for nullptr.

from filament.

elfring avatar elfring commented on May 7, 2024

… for performance reason.

Would you like to point any corresponding source code places out?

This is because a call to free() is expensive …

  • Did you measure such software costs?
  • Do extra pointer checks influence the run time characteristics really in desired ways?

So in case where the call to free() is NOT the common case, it's preferable to check for nullptr.

Do you care for the concrete function call frequency where null pointers will be passed actually?

🔮 How do you think about to update (bundled) software libraries any further?

from filament.

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.