mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Allow users to force gmp to use libgc
* doc/ref/guile-invoke.texi (Environment Variables): Document GUILE_INSTALL_GMP_MEMORY_FUNCTIONS. * libguile/numbers.c (scm_init_numbers): Use environment variable.
This commit is contained in:
parent
04e9245918
commit
534dd35a3c
2 changed files with 22 additions and 0 deletions
|
@ -424,6 +424,19 @@ Guile uses the environment variable @env{HOME}, the name of your home
|
||||||
directory, to locate various files, such as @file{.guile} or
|
directory, to locate various files, such as @file{.guile} or
|
||||||
@file{.guile_history}.
|
@file{.guile_history}.
|
||||||
|
|
||||||
|
@item GUILE_INSTALL_GMP_MEMORY_FUNCTIONS
|
||||||
|
@vindex GUILE_INSTALL_GMP_MEMORY_FUNCTIONS
|
||||||
|
Guile uses the GNU multi-precision (GMP) library to implement its bigint
|
||||||
|
support. It can use an included minimal version of GMP, or the system
|
||||||
|
version, which may be more optimal. If Guile is the sole user of GMP in
|
||||||
|
the process, Guile can tell GMP to allocate its digits using
|
||||||
|
garbage-collected memory. This can be significantly faster. However
|
||||||
|
this approach is unsafe if there are other libraries loaded that use
|
||||||
|
libgmp, such as the GnuTLS library. The default is for Guile to do the
|
||||||
|
fastest safe thing: use the garbage collector for GMP when using the
|
||||||
|
included ``mini-GMP'', but not otherwise. Set this variable to nonzero
|
||||||
|
to force GMP to use garbage-collected memory, even when using system GC.
|
||||||
|
|
||||||
@item GUILE_JIT_THRESHOLD
|
@item GUILE_JIT_THRESHOLD
|
||||||
@vindex GUILE_JIT_THRESHOLD
|
@vindex GUILE_JIT_THRESHOLD
|
||||||
Guile has a just-in-time (JIT) code generator that makes running Guile
|
Guile has a just-in-time (JIT) code generator that makes running Guile
|
||||||
|
|
|
@ -10412,6 +10412,15 @@ SCM_PRIMITIVE_GENERIC (scm_sqrt, "sqrt", 1, 0, 0,
|
||||||
void
|
void
|
||||||
scm_init_numbers ()
|
scm_init_numbers ()
|
||||||
{
|
{
|
||||||
|
/* Give the user the chance to force the use of libgc to manage gmp
|
||||||
|
digits, if we know there are no external GMP users in this process.
|
||||||
|
Can be an important optimization for those who link external GMP,
|
||||||
|
before we switch to the MPN API. */
|
||||||
|
if (!SCM_ENABLE_MINI_GMP)
|
||||||
|
scm_install_gmp_memory_functions
|
||||||
|
= scm_getenv_int ("GUILE_INSTALL_GMP_MEMORY_FUNCTIONS",
|
||||||
|
scm_install_gmp_memory_functions);
|
||||||
|
|
||||||
if (scm_install_gmp_memory_functions)
|
if (scm_install_gmp_memory_functions)
|
||||||
mp_set_memory_functions (custom_gmp_malloc,
|
mp_set_memory_functions (custom_gmp_malloc,
|
||||||
custom_gmp_realloc,
|
custom_gmp_realloc,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue