1
0
Fork 0
forked from len0rd/rockbox

Patch #3022 by Mikael Magnusson: Only zero out the actual bss area instead of the whole plugiin buffer, for faster plugin loading. * Applied the same idea to the overlay loader.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9535 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2006-04-06 18:26:14 +00:00
parent 930785cd8f
commit b509ff5069
2 changed files with 7 additions and 3 deletions

View file

@ -490,8 +490,6 @@ int plugin_load(const char* plugin, void* parameter)
gui_syncsplash(HZ*2, true, str(LANG_PLUGIN_CANT_OPEN), plugin);
return fd;
}
/* zero out plugin buffer to ensure a properly zeroed bss area */
memset(pluginbuf, 0, PLUGIN_BUFFER_SIZE);
readsize = read(fd, pluginbuf, PLUGIN_BUFFER_SIZE);
close(fd);
@ -516,6 +514,9 @@ int plugin_load(const char* plugin, void* parameter)
return -1;
}
plugin_size = hdr->end_addr - pluginbuf;
/* zero out bss area only, above guards end of pluginbuf */
memset(pluginbuf + readsize, 0, plugin_size - readsize);
#endif
plugin_loaded = true;