[libvirt] [PATCH 1/9] util: delete VIR_AUTOFREE

Ján Tomko posted 9 patches 6 years, 3 months ago
[libvirt] [PATCH 1/9] util: delete VIR_AUTOFREE
Posted by Ján Tomko 6 years, 3 months ago
Commit 1e2ae2e311c7453e7894e93688f8785736aa0618 deleted the last use
of VIR_AUTOFREE but forgot to delete the macro definition.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 src/util/viralloc.h | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/src/util/viralloc.h b/src/util/viralloc.h
index c503bbe19b..d7862d6127 100644
--- a/src/util/viralloc.h
+++ b/src/util/viralloc.h
@@ -488,17 +488,3 @@ void virDisposeString(char **strptr)
  */
 #define VIR_DISPOSE(ptr) virDispose(1 ? (void *) &(ptr) : (ptr), 1, \
                                     sizeof(*(ptr)), NULL)
-
-
-/**
- * VIR_AUTOFREE:
- * @type: type of the variable to be freed automatically
- *
- * DEPRECATED: use g_autofree for new code. See HACKING
- * for further guidance.
- *
- * Macro to automatically free the memory allocated to
- * the variable declared with it by calling virFree
- * when the variable goes out of scope.
- */
-#define VIR_AUTOFREE(type) g_autofree type
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/9] util: delete VIR_AUTOFREE
Posted by Michal Privoznik 6 years, 3 months ago
On 10/16/19 2:09 PM, Ján Tomko wrote:
> Commit 1e2ae2e311c7453e7894e93688f8785736aa0618 deleted the last use
> of VIR_AUTOFREE but forgot to delete the macro definition.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>   src/util/viralloc.h | 14 --------------
>   1 file changed, 14 deletions(-)
> 
> diff --git a/src/util/viralloc.h b/src/util/viralloc.h
> index c503bbe19b..d7862d6127 100644
> --- a/src/util/viralloc.h
> +++ b/src/util/viralloc.h
> @@ -488,17 +488,3 @@ void virDisposeString(char **strptr)
>    */
>   #define VIR_DISPOSE(ptr) virDispose(1 ? (void *) &(ptr) : (ptr), 1, \
>                                       sizeof(*(ptr)), NULL)
> -
> -
> -/**
> - * VIR_AUTOFREE:
> - * @type: type of the variable to be freed automatically
> - *
> - * DEPRECATED: use g_autofree for new code. See HACKING
> - * for further guidance.
> - *
> - * Macro to automatically free the memory allocated to
> - * the variable declared with it by calling virFree
> - * when the variable goes out of scope.
> - */
> -#define VIR_AUTOFREE(type) g_autofree type
> 

Now that all VIR_AUTOPTR, VIR_AUTOCLEAN, VIR_AUTOFREE are gone, should 
we remove corresponding paragraph from docs/hacking.html.in:1032 too?

Any new code will not compile if it uses either of those macros.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list