On 16/09/11 22:12, Ulrich Eckhardt wrote:
> Hi!
> 
> I've been wondering why there are ways to append to a strbuf but no way to 
> create one from scratch providing a format string and arguments. Actually, 
> I've found a few places where a strbuf is created (with its default size) and 
> then appended to, possibly causing a reallocation. I think the code overhead 
> of doing it in two steps and the runtime overhead for the reallocation are 
> unnecessary. They are even dangerous in out-of-memory situations if not done 
> correctly.

Dear Ulrich,

Thanks for the patch, but to be honest, I think this just bloats the
API, and that it's not needed. We already have eina_strbuf_manage_new()
that lets you manage a malloced string. Just malloc a string, do
whatever you want to it, and call eina_strbuf_manage_new() that's it.

I really don't like the idea of bloating the API for no reason,
especially for things that can be easily done in other ways, don't you
agree?

On an unrelated note, I think eina_strbuf_(v)printf_new() better follows
our guidelines. Also, your patch contains unrelated style changes.

--
Tom.

------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to