[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-readline] [PATCH] hide symbols for helper xmalloc/xrealloc/xfre
Re: [Bug-readline] [PATCH] hide symbols for helper xmalloc/xrealloc/xfree functions
Fri, 12 Jun 2009 11:25:08 -0400
Thunderbird 18.104.22.168 (Macintosh/20090302)
Robert Millan wrote:
> On Thu, Jun 11, 2009 at 07:27:25PM -0400, Chet Ramey wrote:
>> Robert Millan wrote:
>>> This is troublesome. Imagine you have a large application whose behaviour
>>> relies on a specific behaviour of xmalloc. It is out of the question to
>>> change how this xmalloc will work.
>>> Now imagine you want to use libreadline in this program, and it turns out
>>> your xmalloc breaks it completely.
>>> Is there any reasonable solution to this?
>> This hasn't been a problem to date. As a practical matter, I think the
>> xmalloc/xrealloc interfaces appear in enough Gnu software to have well-
>> known interfaces.
> Right, but what about non-gnu software. xmalloc.c in OpenSSH provides an
> xmalloc() which fails when requested a zero-size block.
I'm actually OK with that one. malloc behavior is implementation-defined:
it's allowed to return NULL when passed a size of 0. Readline should be
able to deal with that. (I wonder what I would find if I changed the bash
xmalloc to do that.)
Readline should be able to deal with a range of reasonable behaviors.
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/