From 171689dac7fcb979e7d3ffbd307eacae3c07c2d3 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 19 Feb 2020 20:55:48 +0100 Subject: nss: Introduce 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 --- malloc/set-freeres.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'malloc/set-freeres.c') diff --git a/malloc/set-freeres.c b/malloc/set-freeres.c index aa80eb6..b328cca 100644 --- a/malloc/set-freeres.c +++ b/malloc/set-freeres.c @@ -20,6 +20,7 @@ #include #include +#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. */ -- cgit v1.1