Ivan Zhakov <i...@visualsvn.com> writes: > On Thu, Aug 15, 2013 at 4:14 PM, Philip Martin <phi...@codematters.co.uk> > wrote: >> Philip Martin <philip.mar...@wandisco.com> writes: >> >>> Ivan Zhakov <i...@visualsvn.com> writes: >>> >>>> Good point. I'll fix it in separate commit. What do you think about >>>> patch itself? >>> >>> Is there any reason for the static optimisation? Does performance >>> matter? Why not simply format each time? >> >> Ah! You don't have a pool. >> > Yes, that is the problem. But I think we can change vtable for RA > layer since it's not part of our API?
Yes, the vtable is private and can be changed. For the original patch an optimising compiler is allowed to reorder the call to apr_snprintf and the assignment to description. However since description_buf is static it will initially be all null so even if there is a thread race the returned buffer should always be a null-terminated string. -- Philip Martin | Subversion Committer WANdisco // *Non-Stop Data*