_mp_alloc vs ALLOC

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Fri Feb 24 11:08:37 CET 2012


Ciao,

Il Ven, 24 Febbraio 2012 10:40 am, Torbjorn Granlund ha scritto:
> I cannot see how TMP_ALLOC_LIMBS_2 could save *anything* for small

I'm not sure I agree with Torbjorn. Nevertheless developers time is a far
more precious resource than a few cpu cycles or bytes of code size...
That's why I completely change my question, always about allocations.


I always used the MPZ_REALLOC macro, to enlarge (if needed) the memory
area available for an integer. This macro gives a (possibly new) pointer
with the requested size available... but it also copies the content.

Sometimes I know in advance that the content can be discarded. Is there a
standard way to ensure a given size without moving data?


Regards,
m

-- 
http://bodrato.it/papers/



More information about the gmp-devel mailing list