[m-users.] Too Slow

Mark Brown mark at mercurylang.org
Wed May 6 16:17:31 AEST 2015


On Wed, May 6, 2015 at 3:45 AM, Matthias Guedemann
<matthias.guedemann at googlemail.com> wrote:
>
>> The advantage would be that you can use libtommath in its default
>> configuration.  Also, as Mark said, you're supposed to call mp_clear
>> because the library author said so.  We're relying on an
>> implementation detail that mp_clear doesn't do anything useful for us.
>
> it sets the allocated memory to zero before freeing and explicitely sets
> the pointer to "NULL" afterwards "to make debugging easier".
>
> So, I think there is no real need to call 'mp_clear'.

You're probably right, but why don't you ask the libtommath
maintainers rather than Mercury users?

Better still, you could ask them for an interface that caters to
garbage collection. Maybe they are already considering it, or unaware
of the demand for it. Or maybe it's already there and I didn't see it.
;-)

Cheers,
Mark.



More information about the users mailing list