memory allocation in mpn routines

Patrick Pelissier patrick.pelissier at
Mon Jul 27 13:26:39 CEST 2009


 You can look at
 to see how GMP handles its memory.

 To make GMP with Hoard, using LD_PRELOAD to preload ""
before running your program should be enough if what I understand  of
the documentation of Hoard is right.

  Patrick Pélissier

On Mon, Jul 27, 2009 at 8:41 AM, souvik bhattacherjee<souvik99 at> wrote:
> Hi all,
> I'm using the low-level mpn routines in a multi-threaded program.  As it is
> well known that malloc () maintains a single heap, and thus only one thread
> can allocate/deallocate memory at any given time, thus degrading performance
> of the multi-thread code. However, as reported in literature this problem
> can be overcome using Hoard, one of the several memory allocators available
> so far. Is the memory allocated to the mpn routines in the form of operands
> sufficient for their computations or do they allocate/deallocate additional
> memory from heap apart from that. Secondly, if at all the routines
> allocate/deallocate additional memory, does it ensure efficient memory
> allocation for multi-threaded applications (like the ones in Hoard) ? If
> not, is it possible to compile GMP with Hoard or something else so as to
> overcome this problem.
> What if someone uses mpz routines or routines other than mpn ?
> Best Regards,
> --
> Souvik Bhattacherjee
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at

More information about the gmp-discuss mailing list