[patch] fix for bug 68181

Luís Pedro Coelho luis at luispedro.org
Sun Dec 28 14:34:11 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> On Saturday 27 December 2003 23:07, Waldo Bastian wrote:
> > I feel a bit uncomfortable with just throwing entries out of the cache.
> > Wouldn't it be better to keep the various types in a different
> > cache-space? (E.g. by prefixing the key used as index into the cache with
> > a
> > type-indicator)

One might as well change the code to use different caches. 

I think that using a prefix on the URL or similiar would be error-prone.
I don't know whether it is worth it, though.

I think the type-conflict case can be looked at as "don't crash on stupid 
input" and it is rare enough (if it wasn't konqueror would crash all over the 
place) that we just need to be correct (not especially efficient or smart).

Le Saturday 27 December 2003 22:48, Dirk Mueller a écrit :
> well, then you end up caching the same data twice in memory. thats not very
> efficient.

Again, I don't think anyone can come up with a file which parses as a script, 
a stylesheet and an image :)

So, just one of these entries would actually get used.

> I think its fine to flush the entry from the memory cache index when the
> type changes. I'm not entirely sure yet if the patch is correct though..
> things like refcounting have to be verified.

removeCachedEntry (as I read it) only removes the entry from the cache. It 
does not delete the object (cache has autoDelete set to false). Any outside 
pointers to the object will still work. I also think that it will still be 
deleted correctly even if not in the cache (from my reading of the code).

Some other code in the file, also does removeCacheEntry without much ado (like 
the preload* functions or needReload() in the second branch), so I took my 
cue from there.

I can rework my patch if the above reasoning is incorrect or if you consider 
that different cache(-spaces) are needed. 

But I believe it can be committed as is. Should I ? 

hth,
- -- 
Luis Pedro Coelho

On user interfaces and languages, see:
http://luispedro.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/7unjGpBAvyRwXdgRApdkAKCstv4J7q5AyJQtIoRxNvmk6rDyOwCdGchk
kjZZfmu0buTh9NtTUSlY43I=
=qyxy
-----END PGP SIGNATURE-----




More information about the kfm-devel mailing list