On Sat, 17 Sep 2011 00:16:52 +0300 Tom Hacohen <t...@stosb.com> said:

> 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.

i think i'll agree with tom, this really just makes 2 lines of code into 1 in
some vary rare cases where this may be used. :(

-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to