[Scummvm-devel] Finding the theme archive via SearchMan

Max Horn max at quendi.de
Tue May 4 01:54:47 CEST 2010


Am 29.04.2010 um 00:32 schrieb sunmax at libero.it:

> Thanks Max!
> 
>>> We would still be looking through the cached list
>>> of files that we already have in memory, yes.
> 
> Got it.
> 
> Then it's the caching process that takes long on PS2,
> and I see now that it's independent from the themes ;-)
> 
> I had a report on forum it might be crashing the PS2 port
> for people that have big HD and gazillions of folders in
> (I guess) the current folder. Do we cache up to a certain
> amount of files (I've got the 1 level recursion part), or
> is there a possibility to trigger a OOM on small devices?

We scan various folders, but not by far the full HD. The cache size is not specified as an explicit number and currently there is no way to limit it; rather SearchMan will simply cache all directories that are add to it, with the depth also given to it. Which may be up to 4, I think, see base/main.cpp:182
  SearchMan.addDirectory(dir.getPath(), dir, 0, 4);

THis is probably not quite optimal, maybe we should only add with a depth of 1 by default, and ask engines/games which require more to manually invoke SearchMan.addDirectory with a suitable depth...

Anyway, I just made a quick test, and added some code which counts how many archives & file nodes are cached. In my test (starting Monkey Island 2), a maximum of 64 files (resp. their "directory entries") were cached. Doesn't sound too excessive...


Bye,
Max



More information about the Scummvm-devel mailing list