summary refs log tree commit diff
path: root/malloc
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-02-19 20:55:48 +0100
committerDJ Delorie <dj@redhat.com>2020-12-04 17:15:05 -0500
commit171689dac7fcb979e7d3ffbd307eacae3c07c2d3 (patch)
treeddd9febed20f88719d7eaf2938798a57b0631074 /malloc
parent7dc2f14bb340bce9a6283dfa7dfde18ec2cb24a2 (diff)
downloadglibc-171689dac7fcb979e7d3ffbd307eacae3c07c2d3.tar.gz
glibc-171689dac7fcb979e7d3ffbd307eacae3c07c2d3.tar.xz
glibc-171689dac7fcb979e7d3ffbd307eacae3c07c2d3.zip
nss: Introduce <nss_module.h>
This provides the struct nss_module type, which combines the old
struct service_library type with the known_function tree, by
statically allocating space for all function pointers.

struct nss_module is fairly large (536 bytes), but it will be
shared across NSS databases.  The old known_function handling
had non-some per-function overhead (at least 32 bytes per looked-up
function, but more for long function anmes), so overall, this is not
too bad.  Resolving all functions at load time simplifies locking,
and the repeated lookups should be fast because the caches are hot
at this point.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'malloc')
-rw-r--r--malloc/set-freeres.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/malloc/set-freeres.c b/malloc/set-freeres.c
index aa80eb64b8..b328cca7c6 100644
--- a/malloc/set-freeres.c
+++ b/malloc/set-freeres.c
@@ -20,6 +20,7 @@
 #include <set-hooks.h>
 #include <libc-internal.h>
 
+#include "../nss/nss_module.h"
 #include "../libio/libioP.h"
 
 DEFINE_HOOK (__libc_subfreeres, (void));
@@ -41,6 +42,8 @@ __libc_freeres (void)
     {
       void *const *p;
 
+      call_function_static_weak (__nss_module_freeres);
+
       _IO_cleanup ();
 
       /* We run the resource freeing after IO cleanup.  */