diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2014-05-10 14:15:22 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2014-05-10 14:15:22 +0000 |
commit | 67b8737ed429810ef35cf464cc924471c5fb29ef (patch) | |
tree | 77d5b5fffab141353771308cfe8dadf756f211a4 /src/htslib.c | |
parent | 9d67ab4cf0f242b0a04f00f133bfaa563b08fb4d (diff) |
Mitigate stash overflow by resizing the hashtable.
Added better logging.
Diffstat (limited to 'src/htslib.c')
-rw-r--r-- | src/htslib.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/htslib.c b/src/htslib.c index 407f225..9248cf9 100644 --- a/src/htslib.c +++ b/src/htslib.c @@ -5116,6 +5116,15 @@ static void default_inthash_asserthandler(void *arg, const char* exp, const char abortf_(exp, file, line); } +static void default_inthash_loghandler(void *arg, inthash_loglevel level, + const char* format, va_list args) { + if (level <= inthash_log_warning) { + fprintf(stderr, "** warning: "); + } + vfprintf(stderr, format, args); + fprintf(stderr, "\n"); +} + static int hts_init_ok = 0; HTSEXT_API int hts_init(void) { const char *dbg_env; @@ -5138,7 +5147,8 @@ HTSEXT_API int hts_init(void) { hts_debug_log_print("entering hts_init()"); /* debug */ /* Init hashtable default assertion handler. */ - inthash_set_global_assert_handler(default_inthash_asserthandler); + inthash_set_global_assert_handler(default_inthash_loghandler, + default_inthash_asserthandler); /* Init threads (lazy init) */ htsthread_init(); |