[RFA] ui-file.[ch]: tell(), mem_filebuf()

Nick Duffek nsd@redhat.com
Thu Dec 14 19:44:00 GMT 2000


On 15-Dec-2000, Andrew Cagney wrote:

>Does your code really have a performance problem serious enough to
>justify direct access to the internal buffer?

The main benefit of mem_filebuf() in my code is not having to free the
buffer it returns.  Without mem_filebuf(), I have to add yet another ugly
cleanup chain.

>If a pointer to the internal buffer was returned, what would the lifetime
>of that buffer be?  Until the next ui_* call

Yes.  It would make sense for me to document that constraint.

>While _*xstrdup() might be O(N) it avoids those problems.

What problems?  I'm proposing a clear, documented, useful interface.  If
developers are unable to follow documented interfaces, _then_ we've got
problems.

Anyway, this isn't important enough to me to engage in a coding philosophy
discussion, so I'm withdrawing the patch.

Thanks for your comments,

Nick


More information about the Gdb-patches mailing list