From c406042241051b3a2eeac79f0462fa2b90da28da Mon Sep 17 00:00:00 2001 From: vlefevre Date: Mon, 21 Aug 2017 09:40:40 +0000 Subject: [doc/mpfr.texi] Added a paragraph about memory allocation by MPFR. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11631 280ebfd0-de03-0410-8827-d642c229c3f4 --- doc/mpfr.texi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/mpfr.texi b/doc/mpfr.texi index 368086afe..f302c29ea 100644 --- a/doc/mpfr.texi +++ b/doc/mpfr.texi @@ -943,6 +943,23 @@ with an implementation-defined TLS specifier). @c is just a GCC extension. There is currently no clear documentation @c about TLS variable initialization. +By default, MPFR currently uses the GMP memory allocators +@ifinfo +(@pxref{Custom Allocation,,, gmp.info,GNU MP}) +@end ifinfo +@ifnotinfo +(see Section ``Custom Allocation'' in @cite{GNU MP}) +@end ifnotinfo +instead of @code{malloc} for all its allocations. But since caches have +been introduced in MPFR and nothing had been documented about necessary +clean-up if the GMP allocators had to be changed (by the application or +another library), the current GMP allocators are memorized the first +time they are used by MPFR, and MPFR will always use these allocators. +This means that the allocators need to remain valid as long as MPFR is +used. To avoid this requirement, MPFR 4 will handle memory allocation +differently, and applications that change the allocators may have to be +slightly modified. + @node MPFR Interface, API Compatibility, MPFR Basics, Top @comment node-name, next, previous, up @chapter MPFR Interface -- cgit v1.2.1