1 /*
2     This file is part of PolyLib.
3 
4     PolyLib is free software: you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation, either version 3 of the License, or
7     (at your option) any later version.
8 
9     PolyLib is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13 
14     You should have received a copy of the GNU General Public License
15     along with PolyLib.  If not, see <http://www.gnu.org/licenses/>.
16 */
17 #include <gmp.h>
18 
mp_get_memory_functions(void * (** alloc_func_ptr)(size_t),void * (** realloc_func_ptr)(void *,size_t,size_t),void (** free_func_ptr)(void *,size_t))19 void mp_get_memory_functions(
20 		void *(**alloc_func_ptr) (size_t),
21 		void *(**realloc_func_ptr) (void *, size_t, size_t),
22 		void (**free_func_ptr) (void *, size_t))
23 {
24     if (alloc_func_ptr)
25 	*alloc_func_ptr = __gmp_allocate_func;
26     if (realloc_func_ptr)
27 	*realloc_func_ptr = __gmp_reallocate_func;
28     if (free_func_ptr)
29 	*free_func_ptr = __gmp_free_func;
30 }
31