bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] please rename xmalloc


From: Chet Ramey
Subject: Re: [Bug-readline] please rename xmalloc
Date: Thu, 09 Jan 2014 14:26:40 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

On 1/9/14 11:58 AM, Tom Tromey wrote:
> Hi.
> 
> Right now, readline exports "xmalloc" and "xrealloc".  I think it would
> be better if these were renamed to be in the readline namespace.
> 
> Currently gdb provides its own xmalloc in the main executable.  This
> overrides the readline xmalloc.  However, while experimenting with
> removing gdb's copy in favor of the libiberty xmalloc, I tripped across
> the readline copy.  Having gdb use libiberty's fails because then gdb
> tries to link against two libraries that each provide their own xmalloc.

That's an interesting problem.  Traditional linker behavior would suggest
that the first library to provide the symbol wins.  Which version of
readline are you using?  Readline-6.1 provided `xfree' in the same file
as xmalloc and xrealloc, and doing so caused the linker to drag in
readline's xmalloc.o, resulting in multiple symbol definitions.

> I can send a readline patch if you think this is acceptable.
> I'd suggest rl_malloc and rl_realloc as new names.

I am too late in my release cycle to get this into readline-6.3, but I
will look at it for the next version.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]