Git Product home page Git Product logo

Comments (2)

gtrevi avatar gtrevi commented on August 9, 2024

Hi @bawilless, thank you for the feedback!

RE: warnings logs, your assumption is correct: by design, the GNU function wrapping applies to the user code and linked static libraries, it cannot apply within libraries that are embedded in the OS image or not linked to your App's executable.

Because from within the free() function itself the caller cannot be determined, unfortunately the wrapped-free-function can't intercept i.e. OS calls and ignore them. That is the reason for that log and the existence of the special _free() function.

Although, if the caller of the native free() is actually freeing memory that was not allocated by your App, that warning can be ignored and just seen as a heads-up; instead, in case your App did own that pointer being logged, then that would be something you want to make sure to account, as that amount of memory being freed will not be tracked in the global heap_allocated variable.

My suggestion is that once you have insured that your App is fully using the _free() wrapper, you could eventually just comment out that log. One useful thing that log does tell though, is exactly what lead you to your assumption (i.e. the calls from outside your code), which in a debugging phase may be useful information (i.e. wither a pointer is being freed for you already by external libraries).

We'll consider this valuable feedback in improving the library. Stay tuned! ;)

from azure-sphere-gallery.

gtrevi avatar gtrevi commented on August 9, 2024

Closing this as feedback is taken.

One more thing, starting from OS 21.07, heap memory tracking now detail separately the heap used by shared libraries:

https://docs.microsoft.com/azure-sphere/app-development/application-memory-usage#add-heap-memory-allocation-tracking

from azure-sphere-gallery.

Related Issues (12)

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.