diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2021-07-14 19:36:18 -0700 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2021-07-14 19:36:18 -0700 |
commit | 3421fa5f5b5ecb6c8136c553cfa10c8ed6803610 (patch) | |
tree | 0d3a4bccc0d977147c8b97d53fdff1a9a2539fa1 | |
parent | fdd53759d859dd44dccff846b9f1d137dcc25cd3 (diff) | |
download | libcap2-3421fa5f5b5ecb6c8136c553cfa10c8ed6803610.tar.gz |
realloc less at startup executing a .so file
A small perf optimization for the common case. Mostly, this change
is to fix a comment.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r-- | libcap/execable.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libcap/execable.h b/libcap/execable.h index 65bacd8..3dff1e9 100644 --- a/libcap/execable.h +++ b/libcap/execable.h @@ -11,7 +11,7 @@ * * Compile your shared library with: * - * -DDL_LOADER="\"ld-linux...\"" (loader for your target system) + * -DSHARED_LOADER="\"ld-linux...\"" (loader for your target system) * ... * --entry=__so_start */ @@ -33,7 +33,7 @@ static void __execable_parse_args(int *argc_p, char ***argv_p) FILE *f = fopen("/proc/self/cmdline", "rb"); if (f != NULL) { char *mem = NULL, *p; - size_t size = 4, offset; + size_t size = 32, offset; for (offset=0; ; size *= 2) { mem = realloc(mem, size+1); if (mem == NULL) { |