summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-01-25 04:45:19 +0000
committermidipix <writeonce@midipix.org>2024-01-25 04:45:19 +0000
commit1b515cefb85e83c444690950bae9ee03bc8def52 (patch)
treede6541c5ff13954dff7bc583c36bb8ab74bd8228
parent1c4fed5505c91cd00f738e5459ab37d0a495c090 (diff)
downloadslibtool-1b515cefb85e83c444690950bae9ee03bc8def52.tar.bz2
slibtool-1b515cefb85e83c444690950bae9ee03bc8def52.tar.xz
slbt_get_archive_meta(): optimize stack utilization.
-rw-r--r--src/arbits/slbt_archive_meta.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arbits/slbt_archive_meta.c b/src/arbits/slbt_archive_meta.c
index 2505a46..f87d262 100644
--- a/src/arbits/slbt_archive_meta.c
+++ b/src/arbits/slbt_archive_meta.c
@@ -23,7 +23,7 @@
#define AR_OBJ_PADDING (0x0A)
/* initial number of elements in the transient, on-stack vector */
-# define AR_STACK_VECTOR_ELEMENTS (0x10)
+# define AR_STACK_VECTOR_ELEMENTS (0x200)
/* transient header info vector */
struct ar_header_info {
@@ -791,7 +791,7 @@ int slbt_get_archive_meta(
/* transient header info vector */
if (&hdrinfov[nentries] == hdrinfov_cap) {
nelements = (nelements == AR_STACK_VECTOR_ELEMENTS)
- ? 0x2000 : nelements + 0x4000;
+ ? (nelements << 4) : (nelements << 1);
if (!(hdrinfov_next = calloc(nelements,sizeof(*hdrinfov))))
return slbt_free_archive_meta_impl(