From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.devel Subject: Re: gmp issues (long) Date: Tue, 25 Feb 2003 16:10:59 -0600 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87wujoqado.fsf@raven.i.defaultvalue.org> References: <87d6lhcnyn.fsf@raven.i.defaultvalue.org> <87y9446pyc.fsf@zagadka.ping.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1046211848 12697 80.91.224.249 (25 Feb 2003 22:24:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 25 Feb 2003 22:24:08 +0000 (UTC) Cc: guile-devel@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18nnUW-0003Hw-00 for ; Tue, 25 Feb 2003 23:24:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18nnSC-0001uj-04 for guile-devel@m.gmane.org; Tue, 25 Feb 2003 17:21:36 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18nnRw-0001tK-00 for guile-devel@gnu.org; Tue, 25 Feb 2003 17:21:20 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18nnNh-00005J-00 for guile-devel@gnu.org; Tue, 25 Feb 2003 17:17:28 -0500 Original-Received: from dsl093-098-016.wdc1.dsl.speakeasy.net ([66.93.98.16] helo=defaultvalue.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18nnHy-0006oF-00 for guile-devel@gnu.org; Tue, 25 Feb 2003 17:11:02 -0500 Original-Received: from raven.i.defaultvalue.org (raven.i.defaultvalue.org [192.168.1.7]) by defaultvalue.org (Postfix) with ESMTP id 321CE3B0; Tue, 25 Feb 2003 16:10:59 -0600 (CST) Original-Received: by raven.i.defaultvalue.org (Postfix, from userid 1000) id 0B354D1021; Tue, 25 Feb 2003 16:10:59 -0600 (CST) Original-To: Marius Vollmer In-Reply-To: <87y9446pyc.fsf@zagadka.ping.de> (Marius Vollmer's message of "25 Feb 2003 21:54:51 +0100") User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:1975 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1975 Marius Vollmer writes: > I'm not so much worried about the size of an mpz_t but about the > fact that it requires an additional malloc. OK, though an extra 6 bytes of overhead (actually 8 if you include the fact that mpzs can't allocate in 2-byte-increments) for a 6 byte integer still concerns me a bit, but perhaps it's OK -- and not worrying about it will certainly keep the code simpler. > 12 bytes is just right for our double cells, tho. So I would > suggest making bignums a double cell and putting the mpz_t structure > into slots 1, 2, and 3. Hmm good idea -- didn't think about the fact that that could work this time... So is there a way we can memcpy the mpz_t data into the double cell's three words, or would I need to pass the individual coerced pieces of the mpz_t to a call to scm_double_cell? i.e. is it OK to presume cell words are guaranteed to be contiguous, or are you required to go through the SCM_CELL_N interface? > There should be a test somewhere whether mpz_t really fits into this > space. For now we can just wait for this test to fail, I'd say. What would be the correct formulation of this test? Would this be right? sizeof (mpz_t) <= 3 * sizeof (SCM) or perhaps given scm_double_cell's prototype sizeof (mpz_t) <= 3 * sizeof (scm_t_bits) > This also removes the additional indirection. Yep. -- Rob Browning rlb @defaultvalue.org, @linuxdevel.com, and @debian.org Previously @cs.utexas.edu GPG starting 2002-11-03 = 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel