1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00
guile/module
Andy Wingo c2247b782a Out-of-memory situations raise exceptions instead of aborting
* libguile/gc.c (scm_oom_fn, scm_init_gc): Install an out-of-memory
  handler that raises an unwind-only out-of-memory exception.
  (scm_gc_warn_proc, scm_init_gc): Install a warning proc that tries to
  print to the current warning port, if the current warning port is a
  file port.
  (scm_gc_after_nonlocal_exit): New interface.  Should be called after a
  nonlocal return to potentially collect memory; otherwise allocations
  could try to expand again when they should collect.

* libguile/continuations.c (scm_i_make_continuation):
* libguile/eval.c (eval):
* libguile/throw.c (catch):
* libguile/vm.c (scm_call_n): Call scm_gc_after_nonlocal_exit after
  nonlocal returns.

* libguile/throw.c (abort_to_prompt, throw_without_pre_unwind): Rework
  to avoid allocating memory.
  (scm_report_out_of_memory): New interface.
  (scm_init_throw): Pre-allocate the arguments for stack-overflow and
  out-of-memory errors.

* module/ice-9/boot-9.scm: Add an out-of-memory exception printer.
* module/system/repl/error-handling.scm (call-with-error-handling): Add
  out-of-memory to the report-keys set.

* libguile/gc-malloc.c (scm_realloc): Call scm_report_out_of_memory if
  realloc fails.

* libguile/error.h:
* libguile/error.c:
* libguile/deprecated.h:
* libguile/deprecated.c (scm_memory_error): Deprecate.

* test-suite/standalone/Makefile.am:
* test-suite/standalone/test-out-of-memory: New test case.
2014-03-22 15:49:31 +01:00
..
ice-9 Out-of-memory situations raise exceptions instead of aborting 2014-03-22 15:49:31 +01:00
language DFG inlines uses of for-each 2014-03-17 10:10:36 +01:00
oop Avoid using 'eval-when' with 'expand' in (oop goops). 2014-02-07 20:05:17 -05:00
rnrs Merge commit '8571dbde63' 2013-11-28 15:00:17 +01:00
scripts Rename "RTL" to "bytecode" 2013-12-02 21:31:47 +01:00
srfi Optimize srfi-1 for-each with two lists. 2014-03-16 19:58:30 +01:00
sxml Remove duplicate definitions of call/ec' and let/ec'. 2013-04-06 15:40:19 +02:00
system Out-of-memory situations raise exceptions instead of aborting 2014-03-22 15:49:31 +01:00
texinfo Improve correctness and consistency of 'eval-when' usage. 2014-01-23 10:41:22 -05:00
web Merge commit 'a5cbbaa66a' 2014-02-07 14:43:23 +01:00
Makefile.am Add prune-top-level-scopes pass 2014-02-13 09:30:39 +01:00
rnrs.scm Add missing R6RS `open-file-input/output-port' procedure 2012-11-12 20:47:57 +01:00
statprof.scm ,profile, statprof, gcprof have an outer stack cut 2014-03-01 16:09:30 +01:00
texinfo.scm Fix newline preservation in @example with lines beginning with @ 2014-02-27 17:16:29 +01:00