guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gmp issues (long)


From: Marius Vollmer
Subject: Re: gmp issues (long)
Date: 25 Feb 2003 21:54:51 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Rob Browning <address@hidden> writes:

> The second (perhaps related) issue involves memory use.  It turns out
> that an mpz_t, which is the GMP integer type, takes up a minimum of 12
> bytes (when an int is 4 bytes), and will always be more than that
> because that 12 bytes doesn't include any space for the actual digits.

I'm not so much worried about the size of an mpz_t but about the fact
that it requires an additional malloc.  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.  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.

This also removes the additional indirection.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405




reply via email to

[Prev in Thread] Current Thread [Next in Thread]