1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Bignums avoid both custom GMP allocator and finalizers

* libguile/deprecated.c (make_bignum): Move here from numbers.c, to
support scm_i_long2big etc.
(scm_i_big2dbl):
(scm_i_long2big):
(scm_i_ulong2big):
(scm_i_clonebig):
(scm_i_normbig): Deprecate.
(scm_install_gmp_memory_functions): Deprecate, happily!  SCM bignums now
have digits allocated inline with the bignum itself, so they are
completely transparent to the GC already.  The price is that if GMP ever
allocates digits via the MPZ API, those digits then have to be copied
back into managed memory.  But we avoid having to install finalizers and
we avoid having to muck with GMP's allocator.
* libguile/numbers.c (scm_from_mpz): Use scm_integer_from_mpz.
(scm_init_numbers): Never muck with GMP's allocators.
* doc/ref/guile-invoke.texi (Environment Variables): Remove note about
GUILE_INSTALL_GMP_MEMORY_FUNCTIONS.
* meta/build-env.in: No need to set GUILE_INSTALL_GMP_MEMORY_FUNCTIONS.
This commit is contained in:
Andy Wingo 2022-01-07 14:01:52 +01:00
parent a0765f564a
commit aa5455ea98
6 changed files with 113 additions and 201 deletions

View file

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (C) 2003, 2006, 2008-2012, 2016, 2017, 2021 Free Software Foundation
# Copyright (C) 2003, 2006, 2008-2012, 2016, 2017, 2021, 2022 Free Software Foundation
#
# This file is part of GNU Guile.
#
@ -90,9 +90,6 @@ done
export LTDL_LIBRARY_PATH
export DYLD_LIBRARY_PATH
GUILE_INSTALL_GMP_MEMORY_FUNCTIONS=1
export GUILE_INSTALL_GMP_MEMORY_FUNCTIONS
if [ x"$PKG_CONFIG_PATH" = x ]
then
PKG_CONFIG_PATH="${top_builddir}/meta"