[kde-freebsd] ARM-related patches for qt4

Michael Nottebrock lofi at freebsd.org
Fri Jul 27 15:46:03 CEST 2007


Björn König schrieb:
> Michael Nottebrock schrieb:
>   
>> [...] One more question, does
>> this malloc.c cause a runtime or a buildtime error?
>>     
>
> Short answer: The file causes a runtime error.
>
> Long answer: Even simple applications don't work, e.g.
>
>     #include <qapplication.h>
>     int main(int argc, char *argv[]) {
>         QApplication app(argc, argv, false);
>         return (app.exec());
>     }
>
> If you execute this program then you'll get the following error message:
>
> ***MEMORY-ERROR***: [8069]: GSlice: failed to allocate 248 bytes
> (alignment: 256): Invalid argument
>
> The reason for this is that glib uses the posix_memalign function which
> has been redefined by malloc.c. In this example the function will be
> called with the parameters alignment=256 and size=248.
>
> POSIX states: "The value of alignment shall be a multiple of sizeof( void
> *), that is also a power of two."
>
> This is true for the alignment parameter, but the posix_memalign function
> of malloc.c does something else:
>
>   if (size % sizeof (void *) != 0 || (size & (size - 1)) != 0)
>
> It does these checks with the size parameter instead. That's why it
> doesn't work at all.
>   
Okay, I'll check in the patch together with a bunch of other changes I
have in the pipeline in the next few days.


Thanks!
-- 

   ,_,   | Michael Nottebrock               | lofi at freebsd.org
 (/^ ^\) | FreeBSD - The Power to Serve     | http://www.freebsd.org
   \u/   | K Desktop Environment on FreeBSD | http://freebsd.kde.org


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/kde-freebsd/attachments/20070727/0e73edd2/attachment.pgp 


More information about the kde-freebsd mailing list