Revision 815947Go back to digest for 8th June 2008
Bug Fixes in KDE Base
Re-enable mmap'ed pixmap caches. Sebastian Sauer and I have been troubleshooting this bug (bug 160284).
This patch does the following, which seems to solve all the SIGBUS issues that we could reproduce:
* Unmap the file before recreating the cache in addition to just invalidating it.
* Make the in memory data structure properly aligned for memory accesses. I did this by making a struct for the header information instead of casting a magic address in order to decode information. This change makes the on-disk layout binary incompatible, so I bumped the pixmap cache version.
Older kdelibs versions will not read the version from the same byte so in case of a mix of kdelibs versions (if you update a running instance for example) I changed the magic character string to fool older kdelibs into seeing it as a newer version.
Doing all this work made my earlier attempts to ensure alignment unneeded.
* The deleteCache() is static, so a list is made of all KPixmapCache::Private classes in the process so they can cleanly unmap before deleting the cache.
* Resizing of the mmap'ed files is only done if such resizing would make the file bigger.
Although I forgot to disable mmap()ed caches in 4.0 branch I'll go ahead and backport this in case we do a 4.0.6.