[Scummvm-devel] Another plugin question

Max Horn max at quendi.de
Wed Sep 9 16:31:19 CEST 2009


[Folks, *please* don't send HTML mails. They make live annoying in  
many ways!]

Am 09.09.2009 um 13:12 schrieb yotam barnoy:


> On Wed, Sep 9, 2009 at 1:01 PM, Marcus Comstedt <marcus at mc.pp.se>  
> wrote:
>
[...]
> > Because the plugins also contain the detection code, so unless we  
> load
> > all plugins, we will not be able to detect all games.
> >
> >
> I realize that that's an issue. Maybe it would be a good idea to  
> allow at
> least the option for the backend to choose to load, detect and then  
> unload
> with every plugin.

That is theoretical possibility. However, you have to realize that  
this will cause a serious overhead if detecting in multiple dirs: Load  
an plugin (lots of disk I/O involved), run the detection code (more I/ 
O involved), unload the plugin, load another, run the detection code  
again (accessing the same files), repeat.

It's certainly possible to do that, but I wonder if it wouldn't slow  
down detection to a crawl on precisely those low-resource devices we  
are trying to help.

The other alternative that has been floated here in the past is to  
separate the detection code from the rest of the plugin, i.e., have  
some kind of two tier plugin system: For each engine, have one small  
plugin which only has the detection code, and one big plugin that has  
the full engine. That solves the above mentioned memory issue, but of  
course complicates the build process and plugin management. But at  
least it should be transparent to the engine if done properly.

>
>
> >
> > > I'm wondering how this works in the memory-limited DC?
> >
> > 16MB is enough to load all plugins, as long as you don't actually
> > start any game.  Before the game is started, all the plugins except
> > the one used for the game are unloaded, which reclaims the memory
> > for dynamic use by the engine.
> >
> >
> 16MB (or 24 on the PSP) is enough for now, but it won't be  
> eventually so
> this may not be a good approach going forward.

You could say the same about almost any feature in any  
application... :). I think we still have quite some room on the 16 MB  
devices.

Anyway, the real problem is the NDS which only has 4 MB ;).


Bye,
Max




More information about the Scummvm-devel mailing list