binfmt/libelf, libs/libc/modlib: Optimize elf load speed: (1) Don't zero out memory, (2) Reduce the initial buffer size to 32 bytes.

This commit is contained in:
Xiang Xiao
2019-01-26 11:34:40 -06:00
committed by Gregory Nutt
parent 264a7164bc
commit 0edcd6b85e
9 changed files with 8 additions and 22 deletions
+2 -2
View File
@@ -33,12 +33,12 @@ config MODLIB_ALIGN_LOG2
config MODLIB_BUFFERSIZE
int "Module I/O Buffer Size"
default 128
default 32
---help---
This is an I/O buffer that is used to access the module file.
Variable length items will need to be read (such as symbol names).
This is really just this initial size of the buffer; it will be
reallocated as necessary to hold large symbol names). Default: 128
reallocated as necessary to hold large symbol names). Default: 32
config MODLIB_BUFFERINCR
int "Module I/O Buffer Realloc Increment"
+1 -1
View File
@@ -261,7 +261,7 @@ int modlib_load(FAR struct mod_loadinfo_s *loadinfo)
/* Allocate memory to hold the ELF image */
loadinfo->textalloc = (uintptr_t)lib_zalloc(loadinfo->textsize + loadinfo->datasize);
loadinfo->textalloc = (uintptr_t)lib_malloc(loadinfo->textsize + loadinfo->datasize);
if (!loadinfo->textalloc)
{
berr("ERROR: Failed to allocate memory for the module\n");
-6
View File
@@ -52,12 +52,6 @@
* Pre-processor Definitions
****************************************************************************/
/* Amount to reallocate buffer when buffer is full */
#ifndef CONFIG_MODLIB_BUFFERINCR
# define CONFIG_MODLIB_BUFFERINCR 32
#endif
/* Return values search for exported modules */
#define SYM_NOT_FOUND 0