]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Much as we have tried not to make it the callers' responsibility
authorJim Pick <jim@kaffe.org>
Tue, 5 Aug 2003 16:05:01 +0000 (16:05 +0000)
committerGary V. Vaughan <gary@gnu.org>
Tue, 5 Aug 2003 16:05:01 +0000 (16:05 +0000)
to maintain an lt_dlrealloc function pointer, it is too difficult
to implement realloc as malloc/memcpy/free without knowing the
size of the original block.  rpl_realloc has been deprecated since
2002-10-30, but kaffe has real failures with that so it's time to
bite the bullet.  Caller gets to maintain lt_dlrealloc:

* NEWS (1.5.1): Updated.
* libltdl/ltdl.c (LT_DLREALLOC): Use lt_dlrealloc so the user can
update the function pointer to match lt_dlmalloc.
(lt_emalloc): Use lt_dlrealloc rather than hardcoding realloc.
* doc/libtool.texi (Libltdl interface): Describe lt_dlrealloc now
that it too has become part of the exported interface to libltdl.

ChangeLog
NEWS
doc/libtool.texi
libltdl/ltdl.c

index 5a70aaf6c6153c9aea120d4d55d47d4c11ee70ad..97d406959d3bd54d4ff729633a8f26d765495f3e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,25 @@
+2003-08-05  Jim Pick <jim@kaffe.org>,
+       Ito Kazumitsu <kaz@maczuka.gcd.org>,
+       Gary V. Vaughan  <gary@gnu.org>
+
+       Much as we have tried not to make it the callers' responsibility
+       to maintain an lt_dlrealloc function pointer, it is too difficult
+       to implement realloc as malloc/memcpy/free without knowing the
+       size of the original block.  rpl_realloc has been deprecated since
+       2002-10-30, but kaffe has real failures with that so it's time to
+       bite the bullet.  Caller gets to maintain lt_dlrealloc:
+
+       * NEWS (1.5.1): Updated.
+       * libltdl/ltdl.c (LT_DLREALLOC): Use lt_dlrealloc so the user can
+       update the function pointer to match lt_dlmalloc.
+       (lt_emalloc): Use lt_dlrealloc rather than hardcoding realloc.
+       * doc/libtool.texi (Libltdl interface): Describe lt_dlrealloc now
+       that it too has become part of the exported interface to libltdl.
+
 2003-08-01  Peter O'Gorman  <peter@pogma.com>
 
        * libtool.m4 (darwin): Use "-undefined dynamic_lookup" if the
-       user set MACOSX_DEPLOYMENT_TARGET to 10.3 or greater.  
+       user set MACOSX_DEPLOYMENT_TARGET to 10.3 or greater.
        * libltdl/ltdl.c (dyld): Save the error from the first lookup
        to report in lt_dlerror(). Otherwise the error is always
        "Symbol _foo not in /usr/lib/libSystem.dylib".
 
        * ltmain.in: search libraries in the order of preference, rather
        than picking .la's even if they're in a less preferred directory.
+
 2003-06-03  Robert Millan <rmh@debian.org>
 
        * ltdl.m4: Add support for GNU/FreeBSD.
 2003-06-03  Peter O'Gorman  <peter@pogma.com>
 
        * libtool.m4 (darwin): Remove checks for Apple-specific gcc.
-       * libltdl/ltdl.c (HAVE_MACH_O_DYLD_H): #define 
+       * libltdl/ltdl.c (HAVE_MACH_O_DYLD_H): #define
        __private_extern__ for fsf gcc.
        * ltmain.in (darwin): Only add new paths to newlib_search_path.
 
        * README: Changed typo in version description.
        * config.guess, config.sub, texinfo.tex:  Synchronized from
        ftp.gnu.org.
-       
+
 
 2003-04-10  Alexandre Oliva  <aoliva@redhat.com>
 
        *destination* ptr to decide how much to copy. This
        sometimes results in out-of-bound accesses which cause
        segfaults. This is a quick hack for now; we may want
-       something cleaner later. (tryall_dlopen_module): check to
-       be sure (dirname_len > 0) before testing first character
-       against '/'. (try_dlopen): check for feof(file) in read
-       loop -- otherwise infloop?
+       something cleaner later.
+       (tryall_dlopen_module): check to be sure (dirname_len > 0) before
+       testing first character against '/'.
+       (try_dlopen): check for feof(file) in read loop -- otherwise
+       infinite loop?
 
 2002-10-25  Robert Boehne  <rboehne@gnu.org>
 
diff --git a/NEWS b/NEWS
index 988fda8962bd60a7852934662416fdb66f2fed2c..532250f9a45d909a6b4d9063ea6c1d9794551206 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,11 @@ NEWS - list of user-visible changes between releases of GNU Libtool
 
 New in 1.5b: 2003-??-??; CVS version 1.5a, Libtool team:
 * Bug fixes.
-
+\f
+New in 1.5.1: 2003-??-??; CVS version 1.5.0a, Libtool team:
+* lt_dlrealloc is an official part of the libltdl API.
+* Bug fixes.
+\f
 New in 1.5: 2003-04-14; CVS version 1.4e, Libtool team:
 * First stable release of multi-language architecture.
 * libtool and libltdl support for Mac OS/X.
index d5ceba0c5a6d9c31719ce811b6409e66b930ec08..ee7308714f3e06901e689a0c3a6f511afb62145d 100644 (file)
@@ -1371,7 +1371,7 @@ any of their required library directories are added to the library path.
 @cindex mode, install
 
 In @dfn{install} mode, libtool interprets most of the elements of
-@var{mode-args} as an installation command beginning with 
+@var{mode-args} as an installation command beginning with
 @code{cp}, or a BSD-compatible @code{install} program.
 
 The following components of @var{mode-args} are treated specially:
@@ -1379,11 +1379,11 @@ The following components of @var{mode-args} are treated specially:
 @table @samp
 @item -inst-prefix @var{inst-prefix-dir}
 When installing into a temporary staging area, rather than the
-final @var{prefix}, this argument is used to reflect the 
+final @var{prefix}, this argument is used to reflect the
 temporary path, in much the same way @code{automake} uses
 @var{DESTDIR}.  For instance, if @var{prefix} is @code{/usr/local},
 but @var{inst-prefix-dir} is @code{/tmp}, then the object will be
-installed under @code{/tmp/usr/local/}.  If the installed object 
+installed under @code{/tmp/usr/local/}.  If the installed object
 is a libtool library, then the internal fields of that library
 will reflect only @var{prefix}, not @var{inst-prefix-dir}:
 
@@ -1399,16 +1399,16 @@ not
 libdir='/tmp/usr/local/lib'
 @end example
 
-@code{inst-prefix} is also used to insure that if the installed 
-object must be relinked upon installation, that it is relinked 
-against the libraries in @var{inst-prefix-dir}/@var{prefix}, 
+@code{inst-prefix} is also used to insure that if the installed
+object must be relinked upon installation, that it is relinked
+against the libraries in @var{inst-prefix-dir}/@var{prefix},
 not @var{prefix}.
 
 In truth, this option is not really intended for use when calling
 libtool directly; it is automatically used when @code{libtool --mode=install}
-calls @code{libtool --mode=relink}.  Libtool does this by 
-analyzing the destination path given in the original 
-@code{libtool --mode=install} command and comparing it to the 
+calls @code{libtool --mode=relink}.  Libtool does this by
+analyzing the destination path given in the original
+@code{libtool --mode=install} command and comparing it to the
 expected installation path established during @code{libtool --mode=link}.
 
 Thus, end-users need change nothing, and @code{automake}-style
@@ -2968,11 +2968,18 @@ function, return -1 and set an error message for retrieval with
 @end deftypefun
 
 @deftypevar {lt_ptr (*) (size_t @var{size})} lt_dlmalloc
+@deftypevarx {lt_ptr (*) (lt_ptr @var{ptr}, size_t @var{size})} lt_dlrealloc
 @deftypevarx {void (*) (lt_ptr @var{ptr})} lt_dlfree
-These variables are set to @code{malloc} and @code{free}, by default,
-but you can set them to any other functions that provides equivalent
-functionality.  However, you must not modify their values after calling
-any libltdl function other than @code{lt_dlpreopen_default} or the macro
+These variables are set to @code{malloc}, @code{realloc} and @code{free} by
+default, but you can set them to any other functions that provide equivalent
+functionality.  If you change any of these function pointers, you will almost
+certainly need to change all three to point into the same malloc library.
+Strange things will happen if you allocate memory from one library, and then
+pass it to an implementation of @code{free} that doesn't know what book
+keeping the allocator used.
+
+You must not modify any of their values after calling any libltdl function
+other than @code{lt_dlpreopen_default} or the macro
 @code{LTDL_SET_PRELOADED_SYMBOLS}.
 @end deftypevar
 
index d45de1550af38a6aac8a51f28f7c7d008e09bdfc..7fbb4a4954a30e90bdb8f9b470439e5af22d850f 100644 (file)
@@ -237,7 +237,7 @@ LT_GLOBAL_DATA void   (*lt_dlfree)  LT_PARAMS((lt_ptr ptr))
 #else
 
 #define LT_DLMALLOC(tp, n)     ((tp *) lt_dlmalloc ((n) * sizeof(tp)))
-#define LT_DLREALLOC(tp, p, n) ((tp *) rpl_realloc ((p), (n) * sizeof(tp)))
+#define LT_DLREALLOC(tp, p, n) ((tp *) lt_dlrealloc ((p), (n) * sizeof(tp)))
 #define LT_DLFREE(p)                                           \
        LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END
 
@@ -1016,7 +1016,7 @@ lt_erealloc (addr, size)
      lt_ptr addr;
      size_t size;
 {
-  lt_ptr mem = realloc (addr, size);
+  lt_ptr mem = lt_dlrealloc (addr, size);
   if (size && !mem)
     LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
   return mem;