[Qt-interest] Replace Qt Allocator

Thiago Macieira thiago at kde.org
Thu Sep 17 07:57:17 CEST 2009


Em Quarta-feira 16. Setembro 2009, às 23.13.13, Eric Clark escreveu:
> The main reason for this post was to understand why Qt offers the ability
>  to "drop-in" a system allocator by changing the source of qFree(),
>  qMalloc() and qRealloc(), if it is not the only thing that needs to be
>  done? I also have to add the global new and delete as mentioned before.
>  This could be easily fixed if Qt had already overridden those operators to
>  invoke the qFree() and qMalloc() that exist in Qt. Then I would have only
>  had to swap out the source of those functions, build QtCore and everything
>  would work just fin

You can easily override qMalloc, but just as you did to your source code, you 
need to override ::operator new() too.

It was never claimed otherwise.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

Qt Developer Days 2009 | Registration Now Open!
Munich, Germany: Oct 12 - 14     San Francisco, California: Nov 2 - 4
      http://qt.nokia.com/qtdevdays2009
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090917/d2ec520c/attachment.bin 


More information about the Qt-interest-old mailing list