From 0db597422f2e5aa5a15342b95b56a0c1247af27f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 24 Jul 2001 21:30:18 +0000 Subject: Update. * iconv/gconv_cache.c (find_module): Don't allocate room for the filename. Use alloca, we don't need it beyond this function. (__gconv_release_cache): New function. * iconv/gconv_db.c (__gconv_close_transform): Call __gconv_release_cache after the steps are handled. * iconv/gconv_dl.c (__gconv_find_shlib): Allocate file name in the record as well. * iconv/gconv_int.h: Add prototype fpr __gconv_release_cache. --- iconv/gconv_db.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'iconv/gconv_db.c') diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c index 92b520987b..47861d19ca 100644 --- a/iconv/gconv_db.c +++ b/iconv/gconv_db.c @@ -713,17 +713,24 @@ internal_function __gconv_close_transform (struct __gconv_step *steps, size_t nsteps) { int result = __GCONV_OK; + size_t cnt; -#ifndef STATIC_GCONV /* Acquire the lock. */ __libc_lock_lock (lock); - while (nsteps-- > 0) - __gconv_release_step (&steps[nsteps]); +#ifndef STATIC_GCONV + cnt = nsteps; + while (cnt-- > 0) + __gconv_release_step (&steps[cnt]); +#endif + + /* If we use the cache we free a bit more since we don't keep any + transformation records around, they are cheap enough to + recreate. */ + __gconv_release_cache (steps, nsteps); /* Release the lock. */ __libc_lock_unlock (lock); -#endif return result; } -- cgit 1.4.1