From: Bruno Haible Date: Sat, 1 Sep 2007 09:17:47 +0000 (+0000) Subject: Explain memory management details. X-Git-Tag: v0.17~277 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f1702b17a583f4d779b01a77b6ce630a4bd3941;p=thirdparty%2Fgettext.git Explain memory management details. --- diff --git a/gettext-runtime/libasprintf/ChangeLog b/gettext-runtime/libasprintf/ChangeLog index 0393c5c89..eb4021a92 100644 --- a/gettext-runtime/libasprintf/ChangeLog +++ b/gettext-runtime/libasprintf/ChangeLog @@ -1,3 +1,9 @@ +2007-09-01 Bruno Haible + + * autosprintf.texi (Class autosprintf): Explain memory mangement + details. + Reported at . + 2007-05-05 Bruno Haible * autosprintf.texi (ifmakeinfo): Remove alias. diff --git a/gettext-runtime/libasprintf/autosprintf.texi b/gettext-runtime/libasprintf/autosprintf.texi index a2b1130cd..0b74d5cbd 100644 --- a/gettext-runtime/libasprintf/autosprintf.texi +++ b/gettext-runtime/libasprintf/autosprintf.texi @@ -33,7 +33,7 @@ This file provides documentation for GNU @code{autosprintf} library. @copying -Copyright (C) 2002-2003 Free Software Foundation, Inc. +Copyright (C) 2002-2003, 2006-2007 Free Software Foundation, Inc. This manual is free documentation. It is dually licensed under the GNU FDL and the GNU GPL. This means that you can redistribute this @@ -63,7 +63,7 @@ A copy of the license is at @url{http://www.gnu.org/licenses/gpl.html}. @page @vskip 0pt plus 1filll @c @insertcopying -Copyright (C) 2002-2003 Free Software Foundation, Inc. +Copyright (C) 2002-2003, 2006-2007 Free Software Foundation, Inc. This manual is free documentation. It is dually licensed under the GNU FDL and the GNU GPL. This means that you can redistribute this @@ -150,7 +150,10 @@ The constructor @code{autosprintf (const char *format, ...)} takes a format string and additional arguments, like the C function @code{printf}. Conversions to @code{char *} and @code{std::string} are defined that return -the encapsulated string. +the encapsulated string. The conversion to @code{char *} returns a freshly +allocated copy of the encapsulated string; it needs to be freed using +@code{delete[]}. The conversion to @code{std::string} returns a copy of +the encapsulated string, with automatic memory management. The destructor @code{~autosprintf ()} destroys the encapsulated string.