[Scummvm-devel] Avoiding loading of all plugins during startup
yotam barnoy
yotambarnoy at gmail.com
Thu Jun 24 06:43:01 CEST 2010
In the interest of making option 1 more palatable to the DC and a good
transition state, what if we had a system parameter which determines
how many plugins we keep loading at a time. Specifically, it would
specify how many bytes of memory the plugins should take up before we
stop loading any more. The default would be 0 meaning that as soon as
a plugin is loaded into memory, it would be used to detect ie. one
plugin at a time. The opposite end of the spectrum would be -1 which
indicates you can load all of the plugins safely before detecting. The
DC could specify 16MB minus the size of the main executable, which
would allow loading of all the plugins into memory before detection
EXCEPT that once there are more plugins than available memory, the
loading would stop, detect, and then wait for the next batch of
plugins to load before detecting again.
This way, it's still a transitional state since it requires the code
not to assume all the plugins are loaded for detection, it's still a
fallback method for option 2, but it's also compatible with the DC's
requirements.
Regarding option 3a: It looks like this option is quite controversial,
and it may involve a lot of unrelated work to get the detection code
separated from the engine code. What if a future engine needs even
tighter integration of the detection code and the engine code? I also
don't like the conceptual division of engine code between the engine
proper and the detection plugin. Nevertheless, I recognize that it's
not a bad option.
Yotam
On Thu, Jun 24, 2010 at 6:19 AM, yotam barnoy <yotambarnoy at gmail.com> wrote:
> On Wed, Jun 23, 2010 at 11:58 PM, Marcus Comstedt <marcus at mc.pp.se> wrote:
>>
>> Max Horn <max at quendi.de> writes:
>>
>>> 1) Quick and simple refinement
>>> ------------------------------
>
>>...
>
>> This would not work so well on the Dreamcast, reason being that the
>> plugins may be on a different CD than the game to be detected
>> (usually, LucasArts did not ship ScummVM plugins on their game discs
>> :). So with this approach, it would be like
>>
>> * Insert ScummVM CD to load first plugin
>> * Swap to game disc, to attempt detection using that plugin (I'm
>> assuming the plugin needs to see the files in order to determine if
>> a game is detected or not)
>> * Swap to ScummVM CD to load next plugin
>> * Swap to game game disc
>> * ...
>>
>
> Once again I forgot about the DC's limitations :(
>
> Any opinion about 2(engine= field) or 3(detection plugin)? Do you use
> a default scummvm.ini?
>
> Yotam
>
More information about the Scummvm-devel
mailing list