[mercury-users] Registering memory deallocation functions

Kral Stefan skral at mips.complang.tuwien.ac.at
Thu Aug 25 02:52:58 AEST 2005

Hi Everyone.

I want to build a little Mercury binding of the GMP BigNum Library.
To do that I need to
	1) allocate some block dynamically using ``mpz_init''
and	2) deallocate the block		   using ``mpz_clear''.

Pt 1 is no problem, as GMP allows to register and use costum 
functions for allocation. I do not know how to address Pt 2.

Do you have any ideas or hints how to register a function 
that should be called when the GC frees an object of
a particular type (say, a GMP integer or float)?

Thank you in advance!

Best regards,

Stefan Kral            http://www.complang.tuwien.ac.at/skral/

mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list