diff options
author | Kevin Ryde <user42@zip.com.au> | 2002-12-21 00:32:42 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2002-12-21 00:32:42 +0100 |
commit | ca73d44e4d4515de20b990ebb36b57642743ce0a (patch) | |
tree | 65a4574d0174fa8bc08baeb0ccccceb141962702 /gmpxx.h | |
parent | f082887e5147bc3ef4850b268b354331feab1b01 (diff) | |
download | gmp-ca73d44e4d4515de20b990ebb36b57642743ce0a.tar.gz |
* gmpxx.h (struct __gmp_alloc_cstring): Use mp_get_memory_functions,
not __gmp_free_func.
Diffstat (limited to 'gmpxx.h')
-rw-r--r-- | gmpxx.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -2328,14 +2328,19 @@ struct __gmp_rand_function /**************** Auxiliary classes ****************/ -/* this is the same as gmp_allocated_string in gmp-impl.h +/* this is much the same as gmp_allocated_string in gmp-impl.h since gmp-impl.h is not publicly available, I redefine it here I use a different name to avoid possible clashes */ struct __gmp_alloc_cstring { char *str; __gmp_alloc_cstring(char *s) { str = s; } - ~__gmp_alloc_cstring() { __gmp_free_func(str, strlen(str)+1); } + ~__gmp_alloc_cstring() + { + void (*freefunc) (void *, size_t); + mp_get_memory_functions (NULL, NULL, &freefunc); + (*freefunc) (str, strlen(str)+1); + } }; |