mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
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:
@@ -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"
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user