From 95f3a1fe3cd09dbe33c3cdec5b1055033bc3a82a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Fri, 18 Oct 2019 23:12:19 +0200 Subject: [PATCH] docs: hacking: mention GLib alternatives of libvirt string allocation macros MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Document the preferred alternatives to existing libvirt macros for allocating strings. These cannot be deleted just yet because converting them will require a lot of work. Signed-off-by: Ján Tomko Reviewed-by: Daniel P. Berrangé Reviewed-by: Andrea Bolognani --- docs/hacking.html.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index 0f4587522d..d60ea5d120 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -1072,6 +1072,18 @@ BAD: VIR_FREEg_free g_free does not zero the pointer + +

String allocation macros and functions:

+ + + + + + + + + +
deprecated versionGLib versionNotes
VIR_STRDUPg_strdup
VIR_STRNDUPg_strndup
virAsprintfg_strdup_printf
virVasprintfg_strdup_vprintuse g_vasprintf if you really need to know the returned length
virStrerrorg_strerrorthe error strings are cached globally so no need to free it

-- 2.47.2