How store libGMP bigint&-ratnum:s within a parent Garbage Collected environment with movable objects so that libGMP values must be absent of any absolute pointers whatsoever?

Tinker tinkr at openmailbox.org
Sat Feb 28 09:33:43 UTC 2015


Hi!

I have a GC:ed heap wherein I want to store my libGMP bigint&-ratnum:s. 
This means that I provide the memory allocator, and also it means that 
libGMP must store one bigint/bigratnum as one single solid byte array 
only, i.e. one such value cannot be split up in more memory allocations, 
because between libGMP calls my GC changes memory location of heap 
objects frequently, and therefore the values may utilize no absolute 
memory pointers.

How do I use libGMP in this way?


As I see it it's extremely important that libGMP supports this, because 
this is the only way that a garbage collected environment.

(Methods with static memory addresses for values would risk memory 
fragmentation, and not being exposed to that risk is the exact reason I 
use a GC.)

Thanks!
Mikael



More information about the gmp-discuss mailing list