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.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    [email protected]    http://cnswww.cns.cwru.edu/~chet/


_______________________________________________
Bug-readline mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to