Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QT and custom allocators



  • Hi all
    I am using QTCore, QTGUI, QTWidget with C++ and would need to track memory allocations to fix huge performance issues in my project. I have custom tracking mechanism, but would need to override malloc/new for the internal allocations that QT does. Googled for a malloc hook or callback or something like that that QT provides, but couldn't find. Can anyone tell me if there is a direct way to inform QT to use custom allocators?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    IIRC, there might something to be done. Have a look at qmalloc.cpp. But I don't remember the exact constraints.

    Hope it helps