Libical memory management

I started looking into libical code after speaking with michael meeks last week. Libical was holding 2500 memory blocks in a temporary buffer ring and was deallocating them in a round robin fashion. The memory blocks also held the strings which was given to its clients. The clients referring to this memory would not know when the string is going to be free’d. I sent my observation and approach to get this fixed to michael who immediately responded with his comments.  The solution is, now libical would not own the memory for the strings returned to the clients and it would use the buffer ring to manage the memory internally for its use while parsing the strings. This will prevent unnecessary memory being stored in libical for every thread and also fix some random crashers which happen due to the temp buffer. I have listed the functions which have been changed in libical here. The changes in EDS have been incorporated. I will be making similar changes in evolution as well probably by this weekend as I have to get on with listing sled evolution patches which needs to be upstreamed and upstream some eds opensuse patches. The other clients such as clock-applet and external backend’s might need to free the strings returned by the following functions  once the patch gets in. I thank michael in advance for his patch review too 🙂