From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: nisse@lysator.liu.se (Niels =?UTF-8?Q?M=C3=B6ller?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#10519: guile and (mini-)gmp Date: Mon, 16 Jan 2012 15:06:48 +0100 Message-ID: References: <87aa5o2bm2.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1326722847 27884 80.91.229.12 (16 Jan 2012 14:07:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jan 2012 14:07:27 +0000 (UTC) Cc: 10519@debbugs.gnu.org, Torbjorn Granlund To: Mark H Weaver Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Jan 16 15:07:20 2012 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RmnDT-0008BB-TY for guile-bugs@m.gmane.org; Mon, 16 Jan 2012 15:07:20 +0100 Original-Received: from localhost ([::1]:34533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmnDT-0002rg-EQ for guile-bugs@m.gmane.org; Mon, 16 Jan 2012 09:07:19 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:43810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmnDN-0002rK-NK for bug-guile@gnu.org; Mon, 16 Jan 2012 09:07:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmnDI-0002Iw-1J for bug-guile@gnu.org; Mon, 16 Jan 2012 09:07:13 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmnDH-0002Is-Sz for bug-guile@gnu.org; Mon, 16 Jan 2012 09:07:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RmnE9-0007fA-Vo for bug-guile@gnu.org; Mon, 16 Jan 2012 09:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: nisse@lysator.liu.se (Niels =?UTF-8?Q?M=C3=B6ller?=) Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 16 Jan 2012 14:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10519 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 10519-submit@debbugs.gnu.org id=B10519.132672286929434 (code B ref 10519); Mon, 16 Jan 2012 14:08:01 +0000 Original-Received: (at 10519) by debbugs.gnu.org; 16 Jan 2012 14:07:49 +0000 Original-Received: from localhost ([127.0.0.1]:59866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RmnDw-0007eg-I2 for submit@debbugs.gnu.org; Mon, 16 Jan 2012 09:07:49 -0500 Original-Received: from mail.lysator.liu.se ([130.236.254.3]:36491) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RmnDt-0007eY-KL for 10519@debbugs.gnu.org; Mon, 16 Jan 2012 09:07:47 -0500 Original-Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id ECEAB40005; Mon, 16 Jan 2012 15:06:49 +0100 (CET) Original-Received: from stalhein.lysator.liu.se (stalhein.lysator.liu.se [IPv6:2001:6b0:17:f0a0::cc]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPS id 9878040002; Mon, 16 Jan 2012 15:06:49 +0100 (CET) Original-Received: from stalhein.lysator.liu.se (localhost [127.0.0.1]) by stalhein.lysator.liu.se (8.14.4+Sun/8.14.4) with ESMTP id q0GE6nOX011757; Mon, 16 Jan 2012 15:06:49 +0100 (MET) Original-Received: (from nisse@localhost) by stalhein.lysator.liu.se (8.14.4+Sun/8.14.4/Submit) id q0GE6mAD011756; Mon, 16 Jan 2012 15:06:48 +0100 (MET) X-Authentication-Warning: stalhein.lysator.liu.se: nisse set sender to nisse@lysator.liu.se using -f In-Reply-To: <87aa5o2bm2.fsf@netris.org> (Mark H. Weaver's message of "Mon, 16 Jan 2012 05:19:33 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6046 Archived-At: Mark H Weaver writes: > Don't worry about this. I have a patch set that (among other things) > reimplements scm_i_big2dbl in a much more robust way, with proper > rounding, and without using such low-level GMP accessors. I posted thi= s > patch set to guile-devel on 7 Oct, "[PATCH] Improvements to exact > rationals et al". I will resubmit it soon. Nice! I take it you mean http://lists.gnu.org/archive/html/guile-devel/2011-10/msg00004.html? Please let me know when you post a new revision. I'm not subscribed to any guile lists. > nisse@lysator.liu.se (Niels M=F6ller) writes: >> 4. mini-gmp has no mp_set_memory_functions. > No, it's much worse than that. If most of the memory being allocated > are bignums, then GC might not be run until the heap is quite large. Will that be a problem in the cases where mini-gmp is relevant? I imagine bignums will usually be at most a dozen limbs, so the storage for limbs should just be a small factor larger than the storage for the mpz_t structs (which are allocated in scheme objects, I assume). > It would be good if you could duplicate the `mp_set_memory_functions' > interface in mini-gmp. I'll consider doing that, then. Are there any alternatives? I guess it should be possible (but maybe inconvenient) to examine the allocation count of each constructed bignum object and inform the gc. I imagine the bignum objects in guile are immutable once created? Regards, /Niels --=20 Niels M=F6ller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance.