> -----Original Message----- > From: development-bounces+kai.koehne=theqtcompany.com@qt- > project.org [mailto:development- > bounces+kai.koehne=theqtcompany....@qt-project.org] On Behalf Of > Robin Burchell > Sent: Friday, February 27, 2015 11:47 AM > To: development@qt-project.org > Subject: Re: [Development] QtCore missing check for memory allocation > > On Fri, Feb 27, 2015 at 9:20 AM, Oswald Buddenhagen > <oswald.buddenha...@theqtcompany.com> wrote: > >> The argument is that it implies runtime overhead. See Robin's email > >> for numbers. This is asking for making the code slower on the very > >> devices where it needs to run faster. > >> > > i don't trust this number. i don't know how qMalloc was implemented, > > but there is no way a simple forwarding wrapper would add 10% overhead > > to malloc (esp. in an optimized build). > > modern processors even have a specific optimization for call > > forwarding (or whatever it's called properly).
qmalloc and friends where implemented in qmalloc.cpp. That is, they can't be inlined, and every call to it from another library will be a cross-library one. A inlined, header-only wrapper should get away with this. Regards Kai _______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development