On 13 August 2004 14:04, Remi Turk wrote:
How do you arrange to free a GMP integer when it is no longer
referenced from the heap? You'd need finalizers, and that way lies
madness. The memory allocation tricks we play with GMP are all to
support GC of Integers.
Errr, I guess I'll have to
On 11 August 2004 20:45, Remi Turk wrote:
But as long as GMP doesn't mind about being abused the way my
most recent util.c does, I can get away with the
mp_set_memory_functions-trick, can't I?
Not really. You can't let GMP realloc() a memory block that was
allocated using one method, with a
On 10 August 2004 16:04, Remi Turk wrote:
- reset GMP's memory allocators before calling it from your code,
and set them back to the RTS allocators afterward. Slow, but it
should work. It doesn't solve the problem properly though:
external libraries which use GMP are still
On Wed, Aug 11, 2004 at 02:27:19PM +0100, Simon Marlow wrote:
On 10 August 2004 16:04, Remi Turk wrote:
http://www.haskell.org/pipermail/glasgow-haskell-users/2004-June/006767.html
Hmm yes, I now realise that it's not quite as easy as I implied in that
message. The problem is the memory
On 09 August 2004 16:57, Remi Turk wrote:
On Sun, Aug 08, 2004 at 07:34:04AM -0700, Sigbjorn Finne wrote:
Hi,
please be aware that the RTS uses GMP as well, and upon
initialisation it sets GMP's 'memory functions' to allocate memory
from the RTS' heap. So, in the code below, the global
On 10 August 2004 13:03, MR K P SCHUPKE wrote:
Re GMP, Why not provide more GMP functions as primitives on the
Integer type, and avoid the need to call out to GMP via the FFI?
Show us the code! :-p
Cheers,
Simon
___
Glasgow-haskell-users
Hi!
On Tue, Aug 10, 2004 at 12:59:46PM +0100, Simon Marlow wrote:
On 09 August 2004 16:57, Remi Turk wrote:
Hm, I _was_ aware of mp_set_memory_functions being used by the RTS.
I've seen it often enough in ltrace's ;)
It does indeed sound rather plausible (and making big allocations
and
- Rename all the symbols in our GMP to be unique. (sounds hard)
Nah, easy.
First get a list of symbols: nm libgmp.a | grep gmp
[Supply a few flags to nm to get a better list.]
Then turn it into a list of #defines:
#define gmp_blah ghc_gmp_blah
...
#include your list of #defines into
On 10 August 2004 14:08, Alastair Reid wrote:
- Rename all the symbols in our GMP to be unique. (sounds hard)
Nah, easy.
First get a list of symbols: nm libgmp.a | grep gmp
[Supply a few flags to nm to get a better list.]
Then turn it into a list of #defines:
#define gmp_blah
On Tue, Aug 10, 2004 at 12:59:46PM +0100, Simon Marlow wrote:
GHC's use of GMP does cause problems if you want to use GMP for your own
purposes, or if you link with external code that wants to use GMP. The
real problem is that GMP has internal state, which means it can't be
used in a modular
On Tue, Aug 10, 2004 at 01:09:03PM +0100, Simon Marlow wrote:
On 10 August 2004 13:03, MR K P SCHUPKE wrote:
Re GMP, Why not provide more GMP functions as primitives on the
Integer type, and avoid the need to call out to GMP via the FFI?
Show us the code! :-p
Or implement Integers via
On Sun, Aug 08, 2004 at 07:34:04AM -0700, Sigbjorn Finne wrote:
Hi,
please be aware that the RTS uses GMP as well, and upon
initialisation it sets GMP's 'memory functions' to allocate memory
from the RTS' heap. So, in the code below, the global variable
'p' will end up having components
On Sun, Aug 08, 2004 at 07:34:04AM -0700, Sigbjorn Finne wrote:
Hi,
please be aware that the RTS uses GMP as well, and upon
initialisation it sets GMP's 'memory functions' to allocate memory
from the RTS' heap.
What about linking Haskell programs with C libraries that use GMP
internally?
FWIW, I couldn't reproduce this problem on my system (i.e. str_test
always printed 1). GHC 6.2.1, libgmp 4.1.3, debian unstable
Abe
On Mon, 9 Aug 2004 17:57:14 +0200, Remi Turk [EMAIL PROTECTED] wrote:
On Sun, Aug 08, 2004 at 07:34:04AM -0700, Sigbjorn Finne wrote:
Hi,
please be aware
On Mon, Aug 09, 2004 at 01:09:40PM -0400, Abraham Egnor wrote:
FWIW, I couldn't reproduce this problem on my system (i.e. str_test
always printed 1). GHC 6.2.1, libgmp 4.1.3, debian unstable
Abe
Same versions here, on an old heavily-patched/FUBAR rock linux
1.4 system.
Does the following
Hi,
please be aware that the RTS uses GMP as well, and upon
initialisation it sets GMP's 'memory functions' to allocate memory
from the RTS' heap. So, in the code below, the global variable
'p' will end up having components pointing into the heap.
Which is fine, until a GC occurs and the
16 matches
Mail list logo