1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 13:00:26 +02:00
guile/module/system/repl
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
..
command.scm Rename objcodes?.{scm,c,h} to loader.{scm,c,h} 2013-11-19 21:45:07 +01:00
common.scm Merge branch 'stable-2.0' 2014-01-14 01:30:56 -05:00
debug.scm rtl-program-code -> program-code 2013-11-19 19:36:27 +01:00
describe.scm Use 'substring' instead of obsoleted 'make-shared-substring' 2011-02-02 05:45:37 -08:00
error-handling.scm Out-of-memory situations raise exceptions instead of aborting 2014-03-22 15:49:31 +01:00
repl.scm Consume a peeked EOF at the REPL. 2013-04-08 08:44:02 -04:00
server.scm REPL Server: Remove unneeded error case in 'run-server'. 2014-02-04 15:15:12 -05:00