X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fmain.cc;h=68fc2a03cb4a4381f4f14f019d88d4e6241194b6;hb=7ba007f37cd2187f60ff7419ee34897ea4651239;hp=c3d449905c01f7556bdd6e6f5c82ad265ddda486;hpb=23dd9fcc841bcf914f7cd0961c262995e0d79cd9;p=lilypond.git diff --git a/lily/main.cc b/lily/main.cc index c3d449905c..68fc2a03cb 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -607,6 +607,12 @@ setup_guile_env () sane_putenv ("GUILE_MIN_YIELD_1", yield, overwrite); sane_putenv ("GUILE_MIN_YIELD_2", yield, overwrite); sane_putenv ("GUILE_MIN_YIELD_MALLOC", yield, overwrite); + + + sane_putenv ("GUILE_INIT_SEGMENT_SIZE_1", + "10485760", overwrite); + sane_putenv ("GUILE_MAX_SEGMENT_SIZE", + "104857600", overwrite); } void @@ -643,3 +649,25 @@ main (int argc, char **argv) /* Only reachable if GUILE exits. That is an error. */ return 1; } + +SCM atexit_list = SCM_EOL; + +LY_DEFINE (ly_atexit, "ly:atexit", + 2, 0, 0, (SCM proc, SCM args), + "Just before exiting, call the procedure given. " +"If this is called multiple times, the procedures are called " +"in LIFO order.") +{ + atexit_list = scm_cons (scm_cons (proc, args), atexit_list); + scm_gc_protect_object (atexit_list); + return SCM_UNSPECIFIED; +} + +LY_DEFINE (ly_do_atexit, "ly:do-atexit", + 0, 0, 0, (), + "Call the atexit procedures.") +{ + for (SCM s = atexit_list; scm_is_pair (s); s = scm_cdr (s)) + scm_apply_0 (scm_caar (s), scm_cdar (s)); + return SCM_UNSPECIFIED; +}