GNOME Bugzilla – Bug 760421
info: expose custom vasprintf implementation
Last modified: 2016-01-13 00:59:52 UTC
gst libraries and/or elements may want to add some debug logging to an external debug system or implement delayed debugging for performance reasons.
Created attachment 318689 [details] [review] info: expose debugging printf functions
Do you need all these different variants? If so, looks fine to me. >+ if (gst_info_vasprintf (&ret, format, args) <= 0) >+ ret = NULL; Not sure about the <= 0 here, format="" should result in an empty return string and not NULL I suppose, or does the return value include the terminator? (Not that it's a terribly important corner case for debugging statements..)
I need at least vasprintf for the length. The others can be implemented on top of that wherever. I also use strdup_vprintf() somewhere else. format="" results in an empty string of length 0 so the length doesn't include the null terminator. I'll fix that so we don't leak memory.
Ok, just checking, please push once that corner case is fixed.
commit 347734e529ba1adadf34116badcddd4e552bfe46 Author: Matthew Waters <matthew@centricular.com> Date: Mon Jan 11 16:31:39 2016 +1100 info: expose debugging printf functions Other gst libraries and/or elements may want to add some debug logging to an external debug system or implement delayed debugging for performance reasons. Exposes the internal __gst_vasprintf as gst_info_vasprintf which has a fallback to g_vasprintf if the debug system is disabled. API: gst_info_vasprintf API: gst_info_strdup_vprintf API: gst_info_strdup_printf https://bugzilla.gnome.org/show_bug.cgi?id=760421