diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2015-01-15 11:52:51 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2015-01-15 11:52:51 +0000 |
commit | ffc254ab3865f9a49e24a6af4e2802627383f9f3 (patch) | |
tree | dce7d671c0b681460d5428d0126b90792ea1214d /main.c | |
parent | Merge branch 'bug/printf' (diff) | |
parent | Drop C99 features (diff) | |
download | w3m-ffc254ab3865f9a49e24a6af4e2802627383f9f3.tar.gz w3m-ffc254ab3865f9a49e24a6af4e2802627383f9f3.zip |
Merge branch 'bug/alloc'
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -383,6 +383,13 @@ make_optional_header_string(char *s) return hs; } +static void * +die_oom(size_t bytes) +{ + fprintf(stderr, "Out of memory: %lu bytes unavailable!\n", (unsigned long)bytes); + exit(1); +} + int main(int argc, char **argv, char **envp) { @@ -412,6 +419,7 @@ main(int argc, char **argv, char **envp) char **getimage_args = NULL; #endif /* defined(DONT_CALL_GC_AFTER_FORK) && defined(USE_IMAGE) */ GC_INIT(); + GC_set_oom_fn(die_oom); #if defined(ENABLE_NLS) || (defined(USE_M17N) && defined(HAVE_LANGINFO_CODESET)) setlocale(LC_ALL, ""); #endif |