[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/icons
From:       Michael Pyne <mpyne () purinchu ! net>
Date:       2008-06-02 21:11:19
Message-ID: 1212441079.744776.17192.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 815947 by mpyne:

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.

CCBUG:160284


 M  +1 -1      kiconcache.cpp  
 M  +253 -158  kpixmapcache.cpp  


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic