This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] ui-file.[ch]: tell(), mem_filebuf()
- To: ac131313 at cygnus dot com
- Subject: Re: [RFA] ui-file.[ch]: tell(), mem_filebuf()
- From: Nick Duffek <nsd at redhat dot com>
- Date: Thu, 14 Dec 2000 22:51:12 -0500
- CC: gdb-patches at sources dot redhat dot com
- References: <3A398103.7D1F05D8@cygnus.com>
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