gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] Re: GCL and GMP


From: Kevin Ryde
Subject: [Gcl-devel] Re: GCL and GMP
Date: Mon, 23 Aug 2004 11:02:07 +1000
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

Camm Maguire <address@hidden> writes:
>
> 1) all arguments distinct -- lonjmp back to the beginning of the call,
>    gc, and try the call again.

Sounds good.  Better than patching gmp to re-fetch pointers from mpz_t
after each memory operation.  (Pretty hairy that, since obviously gmp
is typical C code and plays fast and loose with pointer arithmetic.)

Depending how the evaluator is structured you might even be able to
have a single setjmp point to go back to, rather than a new setjmp on
every mpz call.

> 2) destination arg(s) match some source arg(s) -- satisfy allocation
>    by adding new pages to the heap and schedule a gc call after the
>    gmp call finishes.

I guess if getting close to full you could gc beforehand as a
preventative, ie. to avoid unnecessarily growing the heap.

It shouldn't be too hard to have a stab at what space a gmp call will
want, though it may be unwise to rely on getting that right every time
(since obviously new algorithms or whatever in gmp could change it
very easily).




reply via email to

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