]> git.eshelyaron.com Git - sweep.git/commitdiff
PORT: detect older swipl and disable custom GMP alloc functions
authorEshel Yaron <me@eshelyaron.com>
Thu, 1 Sep 2022 13:47:30 +0000 (16:47 +0300)
committerEshel Yaron <me@eshelyaron.com>
Thu, 1 Sep 2022 13:47:30 +0000 (16:47 +0300)
sweep.c

diff --git a/sweep.c b/sweep.c
index 188ada6f553587205e97b04712e9d2e5c02a8638..2aa552208119a1e3e09627f25e7d4de371897bc9 100644 (file)
--- a/sweep.c
+++ b/sweep.c
@@ -426,7 +426,12 @@ sweep_initialize(emacs_env *env, ptrdiff_t nargs, emacs_value *args, void *data)
       return NULL;
     }
   }
+
+  if (PL_version_info(PL_VERSION_SYSTEM < 80516))
+    PL_action(PL_GMP_SET_ALLOC_FUNCTIONS, FALSE);
+
   r = PL_initialise(nargs, argv);
+
   for (i = 0; i < nargs; i++) {
     free(argv[i]);
   }