search for: gl_lock_t

Displaying 3 results from an estimated 3 matches for "gl_lock_t".

2014 May 29
2
[PATCH] library: per-handle locking support
...t;errno.h> + +#include "glthread/lock.h" +#include "ignore-value.h" + +#include "guestfs.h" +#include "guestfs-internal.h" +#include "guestfs-internal-actions.h" +#include "guestfs_protocol.h" + +#include "locking.h" + +static gl_lock_t guestfs___lookup_lock_or_abort (guestfs_h *g, int *pos); +static void guestfs___per_handle_lock_is_not_held (guestfs_h *g); +static void ___shrink_lock_arrays (void); + + +gl_lock_define (static, *per_handle_locks) +gl_rwlock_define_initialized (static, locks_lock) + +/* items in handles array bije...
2018 Feb 09
2
[PATCH] Add a cache for iconv_t handles to hive_t
...))) == 0) +typedef enum { + utf8_to_latin1 = 0, + latin1_to_utf8, + utf8_to_utf16le, + utf16le_to_utf8, +} recode_type; + struct hive_h { char *filename; int fd; @@ -79,6 +88,11 @@ struct hive_h { /* Internal data for mmap replacement */ void *p_winmap; #endif + + struct { + gl_lock_t mutex; + iconv_t *handle; + } iconv_cache[4]; }; /* Format of registry blocks. NB. All fields are little endian. */ @@ -282,17 +296,16 @@ extern void _hivex_free_offset_list (offset_list *list); extern size_t * _hivex_return_offset_list (offset_list *list); extern void _hivex_print_offset...
2018 Feb 09
3
[PATCH] Add a cache for iconv_t handles to hive_t
It was brought to my attention that dumping a registry hive causes a lot of time spent in disk I/O activity because iconv_open() and iconv_close() are called for every key. Every iconv_open() call causes /usr/lib/.../gconv/$ENCODING.so to be opened and mapped. The iconv_t handles are now cached in the hive_h struct; they are opened on-demand and re-used. On my ~10 year old Lenovo T60, I have