On Mon, 12 Mar 2007, Brian Mattern wrote:
On Mon, Mar 12, 2007 at 12:41:41PM +0100, Stéphane Bauland wrote:Hi people. I needed a function to split a string into a list. My first func used Ecore_List * as return value, and dourse said me that's not really good. He said me to return a char ** so i did it. And i put it under ecore_str.Since you're using an ecore list internally, I don't see why you shouldn't just return that? What was the reasoning behind why "that's not really good"?
In his library, the use of that function is big. Then, the number of allocation is really high (several tens of thousands of allocations for just a test program).
I would not have used ecore_list internally. I would have just parsed 2 times the string in order to build the array of strings. That would lead to allocate only the mem necessary for the storage of the strings.
I told rookmoot to begin with a list, because it's simpler. Only one parsing of the string.
Vincent PS: I've not looked at the code yet.
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel