This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]